Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Audio Button Click Cooldown?

Asked by 3 years ago

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

Log in to vote
0
Answered by 3 years ago

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)

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! Jake821181 2 — 3y
0
also put this script under your button typhoon1421 22 — 3y
0
alright Jake821181 2 — 3y
0
and also remove your play sound script from the button and write it here typhoon1421 22 — 3y
View all comments (3 more)
0
Write it where it says to put the script right? Jake821181 2 — 3y
0
right typhoon1421 22 — 3y
0
This doesn’t seem to work. I’m not sure why Jake821181 2 — 3y
Ad

Answer this question