Here:
1 | x = game.Lighting |
2 | song 1 = x.Song 1 |
3 |
4 |
5 | script.Parent.MouseButton 1 Click:connect( function () |
6 | s = song 1 :Clone() |
7 | s.Parent = game.Workspace |
8 | s:Play() |
9 | end ) |
It works but for everyone in the server so how can i make it to play in the local player? Please help thanks.
put the Sound into StarterGui. if it's a Gui Button then
1 | soundA = game.Players.LocalPlayer.StarterGui.SoundName --I don't Recommend using Numbers |
2 |
3 | script.Parent.MouseButton 1 Click:connect( function () |
4 | soundA:Play() |
5 | end |
make sure this Script is in a LocalScript not a Normal one... else though, if it's in a Brick then
1 | soundA = game.Players.LocalPlayer.StarterGui.SoundName --Same as from above |
2 |
3 | script.Parent.ClickDetector.MouseClick:connect( function () |
4 | soundA:Play() |
5 | end |
Also, in the LocalScript.
Edit:
I forgot that ClickDetector's have MouseClick
not MouseButton1Click
.