I keep getting an error message that it cannot find the LowerTorso in the player's model. The rig type is always R15, and the script has a wait(3)
at the beginning, so the player is loaded before the script starts running. The script is a LocalScript. The line it is in:
1 | local player = game.Players.LocalPlayer -- This line is still OK |
2 | local playerPos = player.Character.LowerTorso.Position --Error happens here |
You might want to add a CharacterAdded
event to make sure that the character is loaded in.
1 | local player = game.Players.LocalPlayer |
2 | player.CharacterAdded:connect( function (character) |
3 | local playerPos = character.LowerTorso.Position |
4 | end ) |
For the beginning, instead of "wait(3)", do "
1 | local player = local player = game.Players.LocalPlayer |
2 | local character = WaitForChild(player.Character) |
3 | local playerPos = character.LowerTorso.Position |
If this helped, up-vote me :D
P.S You can always take Ben's advice if mine doesn't work, he's really good at scripting!