Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Why do I double jump when I hold spacebar?

Asked by 9 years ago

Sorry the script is so long but I really need help. This script works almost perfectly apart from the fact that you can double jump just by holding spacebar, its really annoying and I dont know how to fix this since you're meant to have to double tap the spacebar to perform a double jump. If you need anymore information please please comment.

Theres an article about this script here

Thank you in advance.

01local UserInputService = game:GetService("UserInputService")
02 
03local LocalPlayer = game:GetService("Players").LocalPlayer
04local Character
05local Humanoid
06 
07local DoubleJump = false
08local Debounce = false
09 
10UserInputService.JumpRequest:connect(function()
11    if not Character or not Humanoid or not Character:IsDescendantOf(workspace) or Humanoid:GetState() == Enum.HumanoidStateType.Dead then
12        return
13    end
14 
15    if not Debounce then
View all 52 lines...
0
This is because JumpRequest fires repeatedly while the spacebar is held. DevSean 270 — 9y

Answer this question