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

How Do I Make A Dialog Sound When Click?

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.

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)

1 comment

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