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

How do you add a sound effect when clicked?

Asked by 9 years ago

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

1 answer

Log in to vote
3
Answered by 9 years ago

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.

0
Where do I put the audio ID? in the script.Sound:Play( )? or....what? ChevroletSonic123 15 — 9y
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. JamesLWalker 297 — 9y
Ad

Answer this question