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...

01local player = game.Players.LocalPlayer
02while true do
03    local char = player.Character or player.CharacterAdded:Wait()
04    if char then
05        local humanoid = char:FindFirstChild("Humanoid")
06        if humanoid then
07            humanoid.JumpPower = humanoid.JumpPower + 1
08        end
09    end
10    wait(10)
11end

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
01local Player = game.Players.LocalPlayer
02 
03spawn(function()
04    while wait(10) do
05        if Player.Character then
06            local Humanoid = Player.Character:WaitForChild('Humanoid')
07            Humanoid.JumpPower = Humanoid.JumpPower + 1
08        end
09    end
10end)
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

01spawn(function()
02    script.Name = "SV_JumpPower_Script"
03    for _,player in ipairs(game.Players:GetPlayers()) do
04        coroutine.resume(coroutine.create(function() -- Do this so it dosent stop at the first player
05            while wait(10) do
06                local Character = player.Character
07                local Humanoid = Character:FindFirstChildOfClass("Humanoid")
08                if Character and Humanoid then
09                   Humanoid.JumpPower = Humanoid.JumpPower + 1
10                end
11            end
12        end))
13    end
14end)

Answer this question