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 1 year ago
Edited 1 year 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?:

local Tool = script.Parent
local Jump = 150
local NormJump = 50

Tool.Equipped:Connect(function()
    local humanoid =  Tool.Parent:FindFirstChild("Humanoid")

    if humanoid then
        humanoid.JumpPower = Jump
    end
end)

Tool.Unequipped:Connect(function()
    local humanoid = Tool.Parent.Parent.Character:FindFirstChild("Humanoid")

    if humanoid then
        humanoid.JumpPower = NormJump
    end
end)

Thanks for helping (if you are helping)

0
Script or LocalScript? T3_MasterGamer 2189 — 1y

2 answers

Log in to vote
2
Answered by 1 year ago
Edited 1 year 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 — 1y
0
tysm ur a life saver Puppy_lovertheawsome 84 — 1y
0
glad i helped you dude :) nikitos54327 70 — 1y
Ad
Log in to vote
1
Answered by 1 year 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


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

local Tool = script.Parent

Tool.Equipped:Connect(function()
    local humanoid =  Tool.Parent:FindFirstChild("Humanoid")

    if humanoid then
        humanoid.JumpPower = 150
    end
end)

Tool.Unequipped:Connect(function()
    local humanoid = Tool.Parent.Parent.Character:FindFirstChild("Humanoid")

    if humanoid then
        humanoid.JumpPower = 50
    end
end)
0
sorry but ur both incorrect Puppy_lovertheawsome 84 — 1y
0
sorry but ur both incorrect Puppy_lovertheawsome 84 — 1y
0
sorry but ur both incorrect Puppy_lovertheawsome 84 — 1y
0
Um the answer you accepted does not set the jump height when tool is equipped 666_brithday 103 — 1y

Answer this question