Sound does not play in LocalScript

Play a Sound when ButtonGui is pressed, but the sound is only heard on the Client

The problem is that you can’t hear the sound

the script (in local script):

local SoundService = game:GetService("SoundService")

Button = script.Parent

Button.MouseButton1Down:Connect(function()
	SoundService.SoundLibrary.Effects:WaitForChild("ButtonPress1"):Play()
end)

Button.MouseButton1Up:Connect(function()
	SoundService.SoundLibrary.Effects:WaitForChild("ButtonPress1"):Play()
end)

The sounds are in SoundService, i dont know if that has anything to do with the problem, im sure in my previous games i have played sounds from SoundService in a LocalScript without problems

This happens because LocalScripts only run on the client, so the sound is only played for the client. You could use RemoteEvents if you want it to play for everyone else.

2 Likes

He didn’t say that he wants to play it globally

1 Like

I might be wrong, but isn’t this implying that it does play on only the client?

Oh nevermind I’m just dumb

1 Like

Forget it, the sound only had the volume low while some music was playing in the background lol

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.