✓ Accepted answer
When you say something like game.Workspace, that is sugar for game["Workspace"].
In other words, . is just table-access. And you could, instead of writing game.Workspace write something like
local n = "Workspace"
local w = game[n]
In this case, you could use workspace[player.Name] to find the thing in the workspace with the same name as player.
However, you'll get an error if the object doesn't exist. If you aren't sure that it will exist, you should be using workspace:FindFirstChild(player.Name).
However -- this is NOT how you should be doing this. Player objects have a .Character property which gives you their Character model.
They also have a .CharacterAdded event which will give you their character each time they respawn. Use those.
You normally never need to inspect ROBLOX objects based on their name. You almost always should just keep the thing itself and use its properties, instead of getting a piece of the information and then doing your own search.
4 comments
Thanks! Lol
Nevermind qq Workspace.Script:2: attempt to index field 'Character' (a nil value)
Add the CharacterAdded event of player objects and run a function through that.
I can't believe I forgot to mention the CharacterAdded event... This is quite embarrassing, but I see your question is answered, so no worries