Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Adding a value into this?

How do I sort this out?

		local Name = Player.Name
		PlayerCar = game.Workspace..(Name).Car

I want to be able to make it go into the Workspace and find the Name of the player then inside it 'Car' which is a model.

1 answer

✓ Accepted answer

Try this:

local Name = Player.Name
local PlayerCar = workspace[Name].Car

1 comment

1

Further detail: When you say A.B, what is happening behind the scenes is A["B"]. So game.Workspace is the same as game["Workspace"]; consequently, if you have name = "Workspace"; then game[name] that is also Workspace

This discussion is preserved as it was. New answers, comments, and votes are closed.