When I spam my ability very fast, it triggers 5 times. I have debounce.
How do I solve it?
You didn’t put your script in your post so I’m going to assume that your script is like this:
local Debounce = false
UserInputService.InputBegan:Connect(function(...)
if Debounce == false then
-- Fast ability
Debounce = true
-- Cooldown Code
end
end)
If your script is like this then the script can call the function before Debounce is set true so you should set Debounce true before the fast ability part.
it worked, thank you so much!
1 Like