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

How could i make a script that increases the jumpheight of a player by 1 every 10s?

Asked by
IrishFix 124
5 years ago

I want to have a script that, when a player joins, will increase their jumpheight by 1, every 10s in the game. I know it can use tick or wait, but how?

0
even if they reset? royaltoe 5144 — 5y
0
You should try making an attempt yourself hiimgoodpack 2009 — 5y

3 answers

Log in to vote
1
Answered by 5 years ago

Correct me if I'm wrong but I believe the client has control over their character including WalkSpeed, JumpPower, Velocity, etc...

local player = game.Players.LocalPlayer
while true do
    local char = player.Character or player.CharacterAdded:Wait()
    if char then
        local humanoid = char:FindFirstChild("Humanoid")
        if humanoid then
            humanoid.JumpPower = humanoid.JumpPower + 1
        end
    end
    wait(10)
end

Essentially we have created a loop that will run forever and will add 1 to their current jump power every 10 seconds I don't know why someone would want to do this exactly.

If the client doesn't have control over jump power you can essentially do the same thing on the server using remote events etc... Good luck!

  • Best Regards, -Syn
0
i do not recommend this as the client should NEVER be trusted. as exploiters can easily hack into the script and decompile it to change their jump power, look at my reply for information on how to do it for the server sided script Kriscross102 118 — 5y
Ad
Log in to vote
0
Answered by
pwx 1581 Moderation Voter
5 years ago
local Player = game.Players.LocalPlayer

spawn(function()
    while wait(10) do
        if Player.Character then
            local Humanoid = Player.Character:WaitForChild('Humanoid')
            Humanoid.JumpPower = Humanoid.JumpPower + 1
        end
    end
end)
0
If it is possible i would prefer an answer with more explanation and more in the style to help me understand the components instead of spoon-feeding the script to me, sorry if this is annoying, but it is what i prefer - Irish IrishFix 124 — 5y
0
Fair enough mate, can't argue there. pwx 1581 — 5y
Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

i highly reccommend NOT doing this on a client, as a hacker/exploiter could easily change how high you can jump which is cheating. you should do it on the server instead

spawn(function()
    script.Name = "SV_JumpPower_Script"
    for _,player in ipairs(game.Players:GetPlayers()) do
        coroutine.resume(coroutine.create(function() -- Do this so it dosent stop at the first player
            while wait(10) do
                local Character = player.Character
                local Humanoid = Character:FindFirstChildOfClass("Humanoid")
                if Character and Humanoid then
                   Humanoid.JumpPower = Humanoid.JumpPower + 1
                end
            end
        end))
    end
end)

Answer this question