Hi I am struggling to make the Jump height increase when the The tool is equipped, any ideas on how this could be fixed?:
01 | local Tool = script.Parent |
02 | local Jump = 150 |
03 | local NormJump = 50 |
04 |
05 | Tool.Equipped:Connect( function () |
06 | local humanoid = Tool.Parent:FindFirstChild( "Humanoid" ) |
07 |
08 | if humanoid then |
09 | humanoid.JumpPower = Jump |
10 | end |
11 | end ) |
12 |
13 | Tool.Unequipped:Connect( function () |
14 | local humanoid = Tool.Parent.Parent.Character:FindFirstChild( "Humanoid" ) |
15 |
16 | if humanoid then |
17 | humanoid.JumpPower = NormJump |
18 | end |
19 | end ) |
Thanks for helping (if you are helping)
Your welcome!
Explorer --> StarterPlayer --> Properties --> Character Jump Settings --> Character Use Jump Power = true
If I helped you please mark my answer as best
Make sure this is a normal script I think the issue could be that using local Jump = 150
I fixed your script. Also the other issue I found is that you use different amount of .Parent in your script when it should be the same amount
1 | Tool.Unequipped:Connect( function () |
2 | local humanoid = Tool.Parent.Parent.Character:FindFirstChild( "Humanoid" ) -- This line has 2 Parent |
1 | Tool.Equipped:Connect( function () |
2 | local humanoid = Tool.Parent:FindFirstChild( "Humanoid" ) -- this one only has 1 |
You need to make sure the have the same amount so its either 2 Parent or 1 fix it in the script below
Final
01 | local Tool = script.Parent |
02 |
03 | Tool.Equipped:Connect( function () |
04 | local humanoid = Tool.Parent:FindFirstChild( "Humanoid" ) |
05 |
06 | if humanoid then |
07 | humanoid.JumpPower = 150 |
08 | end |
09 | end ) |
10 |
11 | Tool.Unequipped:Connect( function () |
12 | local humanoid = Tool.Parent.Parent.Character:FindFirstChild( "Humanoid" ) |
13 |
14 | if humanoid then |
15 | humanoid.JumpPower = 50 |
16 | end |
17 | end ) |