Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make my music touch pad have a cooldown?

I don't want the songs to just be spammed anyone know how to make it have cooldown?

3 answers

✓ Accepted answer

Use Debounce.

For Example.

local debounce = false
script.Parent.Touched:connect(function(hit)
if debounce==false then 
debounce = true
print("Reaper5 was here")

--script stuffings here

wait(2)
debounce = false
end
end)

That will make the event only be fired once (if touched) every two seconds.

I'd create a boolean variable called enabled and only let the function run if enabled is set to true otherwise just return out of the function.

Look, This is Scripting Helpers we do not make scripts for other people. Hint on the Helpers just because it has helpers doesn't mean that we make scripts we fix and or repair the scripts.

  • Redstone Studios Corperation

2 comments

0

dude im not asking on making it

0

Making it is worse this is about scripting and "how to make it have cooldown?" How to make it you script it and we fix or repair it.

This discussion is preserved as it was. New answers, comments, and votes are closed.