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

How to put a var on a Workspace line?

Hello guys, I wonder finding how to place a variable on "game:GetService("Workspace").var.Humanoid"...

For example :


local var = game.Workspace.Players.LocalPlayer.Name

game:GetService("Workspace").var.Humanoid

If you could help me, leave a reply.

If you couldn't help me, leave this place.

If you are like me, searching how to do it, follow this thread.

1 comment

0

LocalPlayer is under the Players service, not the Workspace service. Could you possibly be looking for a specific player?

2 answers

You can use [] to index something with a string. So: game:GetService("Workspace")[var].Humanoid

Fun fact: This can also be used for names with spaces

local guntool = game.Players.Backpack["Gun Tool"]

However, you can just do game.Players.LocalPlayer.Character

Reply with further questions,

and please mark as correct if this solution works for you!

1 comment

0

Let me try... I'll edit soon

Thanks, it worked :D have a nice day and thanks again!

1 comment

0

if it works, can you mark my answer as correct?

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