Hello! I would like to know how to access body parts of the local player in a local script, I'm not sure if this is complicated or easy, and I this is what I was told before:
game.Players.LocalPlayer.Character.LeftArm
I'm not sure how to do this, so any help is appreciated, thanks.
So, for accessing the parts, there's two different circumstances you would do this in:
A script that starts with the player
A script that starts with the character
If it starts with the character, your method of game.Players.LocalPlayer.Character.<NAMEHERE>
should work perfectly fine, as the part is always there in the eyes of the script.
However, if the script runs from when the player joins the server, your player will have **multiple **LeftArms, e.c.t. for each death/respawn. To negate this, the script should wait for each character created, then grab the part after.
Here's the code I used, inside of the StarterPlayerScripts, to get each left foot, of the R15 model.
game.Players.LocalPlayer.CharacterAdded:connect(function() print("Character added") local LeftFoot = game.Players.LocalPlayer.Character:WaitForChild("LeftFoot") print(LeftFoot) --Continue your script here... end)
To change the part, simply replace the name in the " " space, with the name of the required part.
If you have any issues, please do reply. Hope I could be of help.