So i want to figure out how to make it so after you click a animation plays for the tool (simple right) so i did that but now the wait (.6 seconds) you can still spam click and have the animation play before the tool is ready to fire again.
is there a way to do this via using just wait(.6) or do i have to have extra lines of code?
local isAnimating = false local function yourFunction() if isAnimating == false then animation:Play() isAnimating = true animation.Stopped:wait() -- wait until this animation stopped! isAnimating = false end end
You can use a variable to show if the animation is playing; and when the animation is done, you can do it again
You could add debounce,
local debounce = false --your script debounce = true wait(.6) debounce = false
Hi, i added debounce via the way you told me to. But i can still spam the animation.