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.
✓ ANSWER ACCEPTED
How Do I Make A Dialog Sound When Click?
1 answer
✓ Accepted answer
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)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Am I doing this right? http://www.roblox.com/unnamed-item?id=314055773