Debounce not working?

i made a double jump script that will only happen once every long while, but the cool down no work

local jumpDebounce = false
local player = game:GetService("Players").LocalPlayer
local uis = game:FindService("UserInputService") or game:GetService("UserInputService")
uis.JumpRequest:Connect(function()
	
	if jumpDebounce == false then

	jumpDebounce = true
	player.Character.Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
	wait(200)
		jumpDebounce = false
		end
end)

you’re not giving it a chance to press space twice to double jump, bc the cooldown is too big

try using delay instead of wait()

local jumpDebounce = false
local player = game:GetService("Players").LocalPlayer
local uis = game:FindService("UserInputService") or game:GetService("UserInputService")
uis.JumpRequest:Connect(function()
	
	if jumpDebounce == false then

	jumpDebounce = true
	player.Character.Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
	delay(200,function()
	        jumpDebounce = false
	end)
	end
end)

hmm seems like the player can still jump infinitely

local jumpDebounce = false
local player = game:GetService(“Players”).LocalPlayer
local uis = game:FindService(“UserInputService”) or game:GetService(“UserInputService”)
uis.JumpRequest:Connect(function()
if not jumpDebounce then
wait(.1)
player.Character.Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
jumpDebounce = true
wait(200)
jumpDebounce = false

end

end)