local UIS = game:GetService("UserInputService")
local debounce = false
UIS.InputBegan:Connect(function(input, GPE)
    if not GPE then
	    if input.KeyCode == Enum.KeyCode.E then
			if not debounce then
		debounce = true
    game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 30
wait(3)
    game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16
wait(5)
local debounce = false
            end
	    end
    end
end)

Ok so when I press the key "E" the players walk speed will be 30 then after 3 seconds it will be 16 walkspeed. The total cool down is 3 seconds running + 5 seconds wait so 8 seconds cool down.

The first time when I click "E" everything worked as it should. But the second time after the cooldown it doesnt work.

Please help. Thanks in advance!

2 comments

0

You have 2 debounces, when changing it back to false, remove the local part and is should work

0

Oh lol , thank you so much! :)))