Attempt to index nil with "JumpPower"

Hello fellow developers!
I am a novice developer developed roblox games for several months.

Now I am writing a simple local script parented to a wing tool
with which a player can jump higher.

The code is simple but always the error message:
'attempt to index nil with “JumpPower” ’ is shown and I don’t know why.

I will appreciate if someone help me.

Instead of making a variable for jump power > try just setting it.

hum.JumpPower = 200

2 Likes

The error is telling you that you’re trying to get the JumpPower of nothing because your hum variable is nil. Try using local hum = chr:WaitForChild("Humanoid") to make the script yield until the Humanoid exists.

2 Likes

Thank you for your quick help. It is ok now!

1 Like

Please mark the most helpful solution as the correct one so other people can easily find the fix if they similar problems.

Yes, I did. I marked Rodtodon’s reply as Solution