Why does Humanoid.JumpPower reset after I jump?

I’m making a jump-power boosting potion for my game and it inserts this script into the workspace that has a value that is equal to the user of the potion:

print("test") -- does print so I know the script is running

local player = script.LinkedPlayer.Value
local Char = player.Character
local Hum = Char:FindFirstChild("Humanoid")

Hum.Died:Connect(function()
    script:Destroy()
end)

Hum.JumpPower = 80

local ParticleEmitter = script.ParticleEmitter:Clone()
ParticleEmitter.Parent = Char.HumanoidRootPart
ParticleEmitter.Enabled = true

wait(20)

Hum.JumpPower = 50 -- resets after 20 seconds
ParticleEmitter:Destroy()
script:Destroy()

I get no errors, but after I jump once, the Jumppower resets back to 50. How do I make it so it permanently stays as 80 until I reset it?

Could you try adding a GetPropertyChangedSignal Event for the Jump property? You could try setting the value there if it keeps resetting :thinking:

Hum:GetPropertyChangedSignal("Jump"):Connect(function()
    Hum.JumPower = 80
    print(Hum.JumpPower)
end)
1 Like

Turns out, I must have a third-party script that is setting the jump power so the issue will now be resolved. I should have checked for this before.

2 Likes

If you’re not sure which script is doing it, you can search in all scripts by pressing Ctrl+Shift+F while a script is open to search for “JumpPower”.

1 Like

Thank you! I actually looked this up earlier, but this is exactly what I needed :+1:!