Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Leaderboard points make you jump higher?

Hello, I've recently need a script that changes their Jump power by their stats.

So lets say a players energy (My point system) is 100, the player would have their jump power. I need it so this loads when the player joins the game as my leaderboard saves and everytime they get a point.

This is my script to give the point to the player.

remote.OnServerEvent:Connect(function(Player)
	local plr = Player
	plr.leaderstats.Energy.Value = plr.leaderstats.Energy.Value +1
end

Thanks!

1 comment

0

post a script

1 answer

✓ Accepted answer

To change how high a player jumps, you have to locate their character and edit the Humanoid's JumpPower.

I've added the line of code for you, however you can edit it any way you would like.

remote.OnServerEvent:Connect(function(Player)
    local Character = Player.Character
    Player.leaderstats.Energy.Value = Player.leaderstats.Energy.Value +1

    if Character then
        if Character:FindFirstChild("Humanoid") then
            Character.Humanoid.JumpPower = Player.leaderstats.Energy.Value + 50 -- 50 is the default jump power, so if their energy is 0 they can still jump normally.
        end
    end
end

2 comments

0

Watch out for the typo on line 6. It was spelled "FidnFirstChild" lol

0

My bad, edited.

This discussion is preserved as it was. New answers, comments, and votes are closed.