Please help! I've been trying to do this for a LONG time
How would you make a Mute + Unmute button for auto-looping music?
3 answers
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)
This discussion is preserved as it was. New answers, comments, and votes are closed.

11 comments
Where would you get a screen GUI? and how do you make frames?
In the Basic Objects side-screen, and same thing for Frames.
How would you make it attatch to the actual music then?
So lets say you have a part in the workspace called soundbox and the sounds name was coolmusic you would change the 'sound = ' line of code to sound = game.Workspace.soundbox.coolmusic
wut? Like I did everything you did up there, I named the text (so people know what it is) Mute / Unmute. But where do I make it, so that it plays my music, AND attatches to that button?
Okay, place the ScreenGui inside the StarterGui, and the Frame inside the ScreenGui, and the TextButton inside the Frame.
Ik Ik, but how do I make the music play? and attached to the button so it will actually stop, and not stop. And it playing.
It is already attached within the script?
Nononoo.... So the stuff is already there that you said above, but the MUSIC PLAYING, How do you insert the song you want in, and make it function with Mute and UnMute?
Insert a Sound object using Basic Objects into a part, then change the Sound ID to the music's ID
Then how do you connect it to the button