I'm interested in knowing how to do a script that makes it so when you jump your jump power goes up by 0.1. I also want this to be separate for each person so one person can have a different jump power than the second. I believe that all you have to do is make a script that knows when the player jumps then go into their humanoid and upgrade their jump power by 0.1. I don't know if the humanoid version is outdated but I'm hoping it still works that way. Thank You
✓ ANSWER ACCEPTED
How i add JumpPower +1 if the player jumps?
2 answers
✓ Accepted answer
Put this in StarterCharacterScripts
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
humanoid.Jumping:Connect(function(Start) -- started jumping
humanoid.JumpPower = humanoid.JumpPower + 0.1 -- gets jumppower and adds 0.1
end)
If you want to change leaderstats you can do this:
- however this must be a Server Script
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
humanoid.Jumping:Connect(function(Start)
humanoid.JumpPower = humanoid.JumpPower + 0.1
game.Players[character.Name].leaderstats.STATNAME.Value = humanoid.JumpPower
end)
However, there is a better way;
- recommend this
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
humanoid.Jump.Changed:Connect(function()
humanoid.JumpPower = humanoid.JumpPower + 0.1
end)
What you will probably want to do is create a regular script but put it in startercharacterscripts. Then you will want the code to be something that detects when the localplayer Is jumping and then adjust the localplayer’s humanoid jump power to add 1 each time a player jumps.
This discussion is preserved as it was. New answers, comments, and votes are closed.
