How do I make a dialog with sound when you click the dialog? But also wait for the sound to cool off before click it again.
This is for a GUI dialog button. You add the sound in the button, then you gotta code the click event:
local Dialog = script.Parent Dialog.MouseButton1Click:connect(function() end)
Then add the sound you want to play when you click the dialog:
Dialog.Sound:Play()
To have the player wait before being able to click again, add a debounce to it and put everything together:
local Dialog = script.Parent local Debounce = false Dialog.MouseButton1Click:connect(function() if Debounce then return end Deounce = true Dialog.Sound:Play() -- More code for the whole dialog Debounce = not Debounce end)