Please help! I've been trying to do this for a LONG time
If you are wanting to do this with a GUI, you put in a ScreenGui, then put a Frame inside that ScreenGui, and size it to however big you want the button to be, then insert a TextButton, inside that Frame and make the size {1,0,1,0}. Then insert this script inside of the TextButton:
stopped = false sound = game.Workspace.LOCATION.Sound script.Parent.Text = "Mute music" script.Parent.MouseButton1Down:connect(function() if stopped == true then sound:Play() stopped = false script.Parent.Text = "Mute music" else sound:Stop() stopped = false script.Parent.Text = "Unmute music" end end)
Please NO DUPLICATE posts.. Its considered spamming.
There is one way for the user to allow them to pause music. But its impossible to mute music when the sound is in Workspace.
My way of doing this is to put a song into everyone's PlayerGui, and when someone requests to mute, you can remove the sound from their PlayerGui. So everyone else can still listen while people who don't want to, don't have to..
huner2 that script did'nt unmute it you had to change the last to stopped = true
stopped = false sound = game.Workspace.Script.Sound script.Parent.Text = "Mute music" script.Parent.MouseButton1Down:connect(function() if stopped == true then sound:Play() stopped = false script.Parent.Text = "Mute music" else sound:Pause() stopped = true script.Parent.Text = "Unmute music" end end)