Auto Jump(Bunny Hop) Not Working

Hello Everyone, I have been working on an auto jump kind of power were you auto jump without having to press your jump button.

Here is an example of what I want to achieve:https://gyazo.com/d3c75ecde54c5620406fad65393f7a33

This is What problem I have:https://gyazo.com/0fce2d3be45f820bd06b44a705c5c364

Here is the script:

local player = game.Players.LocalPlayer

local humanoid = player.Character:WaitForChild("Humanoid")

while true do
	wait(.5)
	humanoid:ChangeState('Jumping')
	
	humanoid:SetStateEnabled('Jumping', false)
end
4 Likes

Yeah since you’re changing state.
Just try setting .Jump property in humanoid to true

humanoid.Jump = true
1 Like

I will try that thx for responding :slight_smile:

1 Like

I still have a tiny small problem you can still jump by your self, How would I fix that?

Here is the problem:https://gyazo.com/1da3d5a87de5741f8f4da8e8605a9f3c

as you can see in the video I still can hold my space bar to jump.

Change the Humanoid’s JumpPower to 0.

Humanoid.JumpPower = 0
1 Like

Would that not make the character able to jump anymore?

Assuming you are attempting to make a system similar to that of Tower of Hell, your issue lies in the delay.

You are trying to wait(0.5), but in that time span the user has time to manually jump - to fix this change your code from wait(n) to just simply wait().

As has become common knowledge at this point, wait in and of itself is unreliable so I recommend adding this code at the top of your script in order to overwrite the default wait function with a more reliable alternative.

local RunService = game:GetService("RunService")
local wait = function(waitTime)
	if not waitTime then waitTime = 0 end
	local startTime = tick()
	repeat RunService.Heartbeat:Wait() until startTime+waitTime < tick()
	return tick()-startTime, elapsedTime()	
end
4 Likes

You can return the player’s ability to Jump by setting the JumpPower to any number higher than 0 (50 is default).

1 Like

That’s just awful. The default jump power is 50

2 Likes

Oops! I mixed it up with Walkspeed.

2 Likes

I will try that thx to all you guys for helping me :slight_smile:

1 Like

I guess you better use @Imp_erator’s solution but heres very simple solution

local player = game.Players.LocalPlayer

local humanoid = player.Character:WaitForChild("Humanoid")


while true do
	humanoid.JumpPower = 0
	wait(.5)
	humanoid.JumpPower = 50
	humanoid.Jump = true
    wait(.3)
	
	
end
2 Likes

Thanks to all you guys, it now works!! But I don’t know which response should I mark as a solution because all you guys helped me together :happy3:

Here is the final result: https://gyazo.com/fa2b19058c5c8f11656f6c60246fe4b6

3 Likes