Stops working/Takes longer to receive input?
Hi, I'm making a double-jump script, and it seems to work fine- for the first jump-or-so.
then it takes longer to preform the second jump, make the second jump trigger randomly, etc.
I think it has something to do with the "jump" variable.
This seems to stop working, or at lest take longer to do the function, can anyone tell me how to fix it?
01 | repeat wait( 0.25 ) until game.Players.LocalPlayer |
02 | local Plr = game.Players.LocalPlayer |
03 | local Mouse = Plr:GetMouse() |
04 | local Character = Plr.Character |
06 | Character.Humanoid.Jumping:connect( function (jumping) |
07 | Character.Humanoid.FreeFalling:connect( function (fall) |
08 | Mouse.KeyDown:connect( function (Key) |
09 | repeat wait() until fall = = false and jumping = = false and jump = = 0 or Key:byte() = = 32 and fall = = true and jump ~ = 2 |
10 | if Key:byte() = = 32 and fall = = true or jump = = true and jump ~ = 2 then |
11 | Character.Torso.Velocity = (Vector 3. new( 0 , 55 , 0 )) |
15 | if jump = = 2 or jump = = 1 then jump = 0 end |
16 | elseif falling = = true and jumping = = false then |
18 | elseif fall = = false and jumping = = false then |