I was making some sound blocks that play audios when you click them, but I don’t know how to make a cooldown for it? I was wondering if I can get help with this. Thanks!
COMMUNITY QUESTION
Audio Button Click Cooldown?
1 answer
try doing this
local cooldown = 10
local cd = false
script.Parent.MouseButton1Click:Connect(function()
if cd = false then
cd = true
--Your play sound script here
wait(cooldown)
cd = false
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

7 comments
Thank you! I am currently going to bed but when I wake up I will try it and I will see what happens. Thanks!
also put this script under your button
alright
and also remove your play sound script from the button and write it here
Write it where it says to put the script right?
right
This doesn’t seem to work. I’m not sure why