How to allow infinite jumps?

How can I allow the player to infinite jump? In a way I can turn it on and off with a simple function.
I also want a tiny cooldown! I’m new here :baby: and I don’t really know how to do this :confused:

Shoutout to @VonsRevenges (aka KingVamp) for helping me last time :heart:
Edit: And this one too thx

2 Likes

You can do it like this:

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

local canJump = true
local jumpCooldown = 0.3 -- Cooldown time in seconds

local function onJumpRequest()
	if canJump then
		humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
		canJump = false
		task.wait(jumpCooldown)
		canJump = true
	end
end

game:GetService("UserInputService").JumpRequest:Connect(onJumpRequest)

this script listens for the jumprequest and forces the humanoid to keep jumping.
(you can edit the jumpCooldown time as much as you want)

1 Like

Oh here you are again :stuck_out_tongue:
I tested it and it worked just nice! I changed jumpCooldown to 0.1 to fit better what I wanted.
Thank you so much I didn’t expect someone to make a whole script like that :heart:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.