Hello ScriptingHelpers,
This is a simple question but not too simple for me. How can I prevent the "reset" of one animation?
I mean, I have an animation, when I press Space the animation starts. If I press Space multiple times the Animation stops and start again and looks pretty bad.
I want that if the Player hits the Space multiple times don't do anything before the Animation ends.
I was thinking about using the wait() function but I don't really know how to implement that with animations.
I really appreciate any help you can provide.
Debounces are a good way of doing this, as with the touched event.
Example:
local debounce = false script.Parent.Touched:connect(function(playerWhoTouched) if not debounce then --If the debounce isn't activated debounce = true --Activate it print("TOUCHED") wait(5) debounce = false --Deactivate It end end)
To those who look at this answer, please excuse my wording!