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

scripting a gui button with sound?

i need help with adding music to a button gui. do i have to put it in replicatedfirst, and add sound?

1 answer

All you need is the GUI in PlayerGui, and a Sound instance in it (preferably inside the button) then you need this in a localscript (also in the button):

sound = script.Parent.Sound --change this to the path to the sound
script.Parent.MouseButton1Click:connect(function() --When a player clicks the GUI then...
sound:Play() --Play the sound
end) --Close the function

To answer your question: No, you do not need to put it in replicatedfirst.

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