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

Audio Button Click Cooldown?

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!

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)

7 comments

0

Thank you! I am currently going to bed but when I wake up I will try it and I will see what happens. Thanks!

0

also put this script under your button

0

alright

0

and also remove your play sound script from the button and write it here

0

Write it where it says to put the script right?

0

right

0

This doesn’t seem to work. I’m not sure why

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