Jump Request fires rapidly in double jump script

Can you help me please? My double Jump script doesn’t work properly when using jump request. It fires too quickly. I know that this glitch is common but can someone please give me an alternative please?

1 Like

I don’t have this issue with JumpRequest. Can you show reproduceable code?

1 Like

local char = script.Parent
local Humanoid = char:WaitForChild(“Humanoid”)
local OnGround = true
local CanDouble = false
local UIS = game:GetService(“UserInputService”)

Hum.StateChanged:Connect(function(old,new)
if new == Enum.HumanoidStateType.Freefall and OnGround then
if not CanDouble then
CanDouble = true
OnGround = false
end
elseif Humanoid.FloorMaterial ~= Enum.Material.Air then
OnGround = true
CanDouble = false
end
end)

UIS.JumpRequest:Connect(function()
if CanDouble then
CanDouble = false
Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
end
end)

Is there any solution to this?

You can add debounce, it should help you. The jump request keeps firing while you are pressing Space.

How do you use that? I know what it is but I wouldn’t know how to use it in my script.

It is pretty simple. Let me show.

local debunce,debuncetime = true,1

local function DoSomething()
       if debunce then
              print("Do Something")
              debunce = true
              wait(debuncetime)
              debunce = true
      end
end

The debunce I did is NOT perfect, you should call corountine.wrap(DoSomething)() for it.

It seems like something that might work. I’ll look into it. Thanks!

Very late reply but I figured denounces didn’t work but I found a workaround by using the actual jump button gui for mobile players and using mousebutton1down but thanks for the help!

1 Like