This double jump script I made works however it sometimes fails to double jump and occasionally breaks completely, it's becoming really annoying and I can't pinpoint where the error is because there's nothing in the output.
I was hoping someone else could help me...Heres the script:
local Player = game.Players.LocalPlayer
while not Player.Character do
wait()
end
local character = Player.Character
local mouse = Player:GetMouse()
local humanoid = character:WaitForChild("Humanoid")
local torso = character:WaitForChild("Torso")
local head = character:WaitForChild("Head")
local debounce = true
mouse.KeyDown:connect(function(key)
if key:byte() == 32 then
if humanoid.Jump == true then
if debounce == false then
return
end
debounce = false
local torso = character:FindFirstChild("Torso")
torso.Velocity = Vector3.new(torso.Velocity.X, humanoid.JumpPower * 1.7, torso.Velocity.Z)
end
repeat wait() until humanoid.Jump == false and humanoid:GetState() == Enum.HumanoidStateType.Landed
debounce = true
end
end)
Thank you for your time.

2 comments
repeat wait() until humanoid.Jump == false and humanoid:GetState() == Enum.HumanoidStateType.Landed(source of error) and look at where your end statement for the inner if statement.
KeyDown is deprecated. That may be why it won't work.