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

Trying to add a variable to something but it throws errors, How do I do this?

dog = Game.Players.LocalPlayer
print(dog)
Game.Workspace.dog.Torso.Anchored = true

I want to do this because Game.Workspace.LocalPlayer does not work, is there any way I can do this?

1 answer

Right. There is another thing under LocalPlayer called Character . A character is basically an NPC that you control.

local dog = game.Players.LocalPlayer --You misspelled game as Game.
print(tostring(dog.Name)) --If you wanna get the player, you have to do player.Name

dog.Character.Torso.Anchored = true

2 comments

0

Ahh, I didn't know about the characters part, so I could just do

0

"game.Players.LocalPlayer.Character.Torso.Anchored = false" Tried to do a new line but it just posted the comment

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