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

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

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?

2 comments

0

even if they reset?

0

You should try making an attempt yourself

3 answers

✓ Accepted answer

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

1 comment

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

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)

2 comments

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

0

Fair enough mate, can't argue there.

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)

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