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

How do you add a sound effect when clicked?

For example: If you click on a GUI button it makes a sound like FX or music.

1 answer

You'll need to have a sound inside the localscript, then if you put a localscript inside a GUI it should look something like this:

script.Parent.MouseButton1Click:connect(function()
	script.Sound:Play()
end

This basically just makes it so when you click the button a sound that you choose will play. Hope this script helps you, and others.

2 comments

0

Where do I put the audio ID? in the script.Sound:Play( )? or....what?

0

For the sound, right click the localscript. Then for audio id use this formula: 'http://www.roblox.com/asset/?id=' then the sound id. For example 'http://www.roblox.com/asset/?id=180877191' will play a notification beep. Hope this helps.

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