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

How to make a button play a sound for the localplayer when clicked?

Asked by
pevdn 32
4 years ago

I know how to play a sound broadcasting to the whole server, but how would I make it so it only broadcasts the the single player? I already have a clickdetecter script ready.

I have tried -

local clickdetector = script.Parent.ClickDetecter

clickdetecter.MouseClick:Connect(function(Player)
Sound:Play
LOCALSCRIPT-
local clickdetector = script.Parent.ClickDetecter

clickdetecter.MouseClick:Connect(function()
Sound:Play
0
Is this a part or GUI? Your script is also malformed. Ziffixture 6913 — 4y
0
The sound has not been defined so it doesnt know what to play.Also is the clickdetector named clickdetecter?Make sure to put your script inside a localscript as well.If it doesnt work to put clickdetector script inside a localscript you can't use remote events to change something only for the player.Hope I helped you.I will try to make a quick script. SitaruDaniel 44 — 4y

Answer this question