I'm really new to scripting and I'm just barely learning onClicked functions. I want to make a part that when it gets clicked, it plays a sound. I don't want the sound to be played to the entire server though. How would I do this?
COMMUNITY QUESTION
How would I make a part that plays a sound when clicked?
1 answer
part = script.Parent sound = script.Parent.Sound
function onClicked() sound:Play()
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
This should work also you must inset ClickDetector and Sound into the part. FYI this is not a very hard thing to look for next time you should look else where.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Also please separate the sound = script.Parent.Sound by hitting enter
It actually is hard to find. When you google it you get "How to make a music GUI button"