Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Confused on small script that changes jump height, Any ideas?

Asked by 2 years ago
Edited 2 years ago

Hi I am struggling to make the Jump height increase when the The tool is equipped, any ideas on how this could be fixed?:

01local Tool = script.Parent
02local Jump = 150
03local NormJump = 50
04 
05Tool.Equipped:Connect(function()
06    local humanoid =  Tool.Parent:FindFirstChild("Humanoid")
07 
08    if humanoid then
09        humanoid.JumpPower = Jump
10    end
11end)
12 
13Tool.Unequipped:Connect(function()
14    local humanoid = Tool.Parent.Parent.Character:FindFirstChild("Humanoid")
15 
16    if humanoid then
17        humanoid.JumpPower = NormJump
18    end
19end)

Thanks for helping (if you are helping)

0
Script or LocalScript? T3_MasterGamer 2189 — 2y

2 answers

Log in to vote
2
Answered by 2 years ago
Edited 2 years ago

Your welcome!

Explorer --> StarterPlayer --> Properties --> Character Jump Settings --> Character Use Jump Power = true

If I helped you please mark my answer as best

0
ok Puppy_lovertheawsome 84 — 2y
0
tysm ur a life saver Puppy_lovertheawsome 84 — 2y
0
glad i helped you dude :) nikitos54327 70 — 2y
Ad
Log in to vote
1
Answered by 2 years ago

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

1Tool.Unequipped:Connect(function()
2    local humanoid = Tool.Parent.Parent.Character:FindFirstChild("Humanoid")-- This line has 2 Parent
1Tool.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

01local Tool = script.Parent
02 
03Tool.Equipped:Connect(function()
04    local humanoid =  Tool.Parent:FindFirstChild("Humanoid")
05 
06    if humanoid then
07        humanoid.JumpPower = 150
08    end
09end)
10 
11Tool.Unequipped:Connect(function()
12    local humanoid = Tool.Parent.Parent.Character:FindFirstChild("Humanoid")
13 
14    if humanoid then
15        humanoid.JumpPower = 50
16    end
17end)
0
sorry but ur both incorrect Puppy_lovertheawsome 84 — 2y
0
sorry but ur both incorrect Puppy_lovertheawsome 84 — 2y
0
sorry but ur both incorrect Puppy_lovertheawsome 84 — 2y
0
Um the answer you accepted does not set the jump height when tool is equipped 666_brithday 103 — 2y

Answer this question