Ad
Log in to vote
0

JumpRequest firing multiple times?

Asked by
Dorx86 0
4 days ago
Edited 4 days ago

Not sure what is wrong with the script, JumpRequest is being fired sometimes more than once.

CanDoubleJump = false
LastJumpTick = tick()

game:GetService("UserInputService").JumpRequest:Connect(function()
    if CanDoubleJump == false then
        CanDoubleJump = true
    elseif CanDoubleJump then
        if tick() - LastJumpTick <= 0.5 then
            print("DOUBLE JUMPED!")
        end

        CanDoubleJump = false
    end

    LastJumpTick = tick()
end)
0
i put this into a local script in StarterCharacterScripts and it works fine doesn't print twice Nogalo 78 — 4d
0
It works only when u press spacebar in intervals, if you hold spacebar it will print multiple times. Dorx86 0 — 4d

Answer this question