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

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

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

2 answers

✓ Accepted answer

Here is what you need to do:

Insert a LocalScript inside StarterGui and type this:

local CD = game.Workspace.Part.ClickDetector -- That is just an example of where your click detector is

CD.MouseClick:Connect(function()
	game.Workspace.Sound:Play()
end)

Use A Local Script Since The Local Script Only Affects A Local Player

1 comment

0

It did not work, read the description please.

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