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

Sound stops for server instead of single player?

local music = game.Workspace.BGM

script.Parent.TextButton.MouseButton1Click:Connect(function()
	
if music.Volume == 0 then
	
	music.Volume = 2.5
	
	else
		
	 music.Volume = 0
end
end)

This script above is a LocalScript inside a ScreenGui.

local sound = game.Workspace.BGM
local muted = false
script.Parent.MouseButton1Click:Connect(function()
	if muted then
		sound:Resume()
		muted= false
		script.Parent.Text = "Mute Music"
	else
		sound:Pause()
		muted = true
		script.Parent.Text = "Unmute Music"
		end
end)

This script is a LocalScript inside a TextButton inside the same ScreenGui with the first script, that makes the sound stop when pressed upon.

1 answer

✓ Accepted answer

You are calling a sound instance that is in workspace. I recommend putting the sound instance inside StarterGui instead. I hope this helps! If this does answer your question, please mark it as solution to boost my reputation) :)

1 comment

0

cool

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