so the cooldown works only one time but it breaks after. some guy told me to make 2 debounces, 1 to make sure you don't deactivate the cooldown numerous times, and one for the actual cooldown but i don't really understand what i have to do since i am a beginner. Can someone help me?
local play = game.Players.LocalPlayer
local uis = game:GetService("UserInputService")
local Character = play.Character or play.CharacterAdded:wait()
local a = script.Parent.Animations.Blocking
local b = play.Character:WaitForChild("Humanoid"):LoadAnimation(a)
local debounce = false
local remote = game.ReplicatedStorage:WaitForChild("blockinge")
uis.InputBegan:Connect(function(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.F and not gameProcessed and not debounce then
debounce = true
remote:FireServer()
b:Play()
end
end)
uis.InputEnded:Connect(function(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.F and not gameProcessed and debounce then
b:Stop()
wait(5)
debounce = false
end
end)
