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:
local player = game.Players.LocalPlayer -- This line is still OK 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.
local player = game.Players.LocalPlayer player.CharacterAdded:connect(function(character) local playerPos = character.LowerTorso.Position end)
For the beginning, instead of "wait(3)", do "
local player = local player = game.Players.LocalPlayer local character= WaitForChild(player.Character) 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!