local script_is_running = false script.Parent.Touched:connect(function (newbie) script_is_running = true -- SCRIPT STUFF HERE wait(5) script_is_running = false end)
Will prevent it from being fired every 5 seconds.
if you found this useful please choose it as the correct answer
debounce is mainly in tools (Supposedly) Also mainly in hats. I believe it is in a Touched function.
Debounce is used so a function's event doesn't run too many times For example:
Debounce=true Part=Workspace.Part function ChangeColor() if Debounce==true then Deb=false Part.BrickColor=BrickColor.new"Bright red" wait(2) Part.BrickColor=BrickColor.new"Bright blue" Debounce=true end script.Parent.Touched:connect(ChangeColor)
Here If the Debounce is true then the function will start when the event is connected to the function and it will not fire if the Debounce is false. Instead of using Debounce you can use a wait() to stop functions from clashing.