How to get a players character without "attempted to index nil with 'Character'"?
This is really annoying me. I was trying to make the player jump in a script when they clicked a button, but output just says "attempt to index nil with 'Character'". It's in a server side script, and the local player had already been addressed and everything. I have tried this:
1 | lp = game.Players.LocalPlayer |
and this:
1 | lpc = game.Players.LocalPlayer.Character |
also this...
1 | lp = game.Players.LocalPlayer |
2 | lpc = game.Workspace:FindFirstChild(lp.Name) |
this was the code for the jump... (inside of a function)
1 | lpc.Humanoid.Jump = true |
Why does this keep happening? Why does it work in scripts other than mine? I'm only getting errors for this part of the script. If you need me to release the whole script, I will.