Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-4

How would you make a Mute + Unmute button for auto-looping music?

Asked by 10 years ago

Please help! I've been trying to do this for a LONG time

3 answers

Log in to vote
0
Answered by
Sublimus 992 Moderation Voter
10 years ago

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)
0
Where would you get a screen GUI? and how do you make frames? CrazyRocker60 17 — 10y
0
In the Basic Objects side-screen, and same thing for Frames. Sublimus 992 — 10y
0
How would you make it attatch to the actual music then? CrazyRocker60 17 — 10y
0
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 Sublimus 992 — 10y
View all comments (7 more)
0
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? CrazyRocker60 17 — 10y
0
Okay, place the ScreenGui inside the StarterGui, and the Frame inside the ScreenGui, and the TextButton inside the Frame. Sublimus 992 — 10y
0
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. CrazyRocker60 17 — 10y
0
It is already attached within the script? Sublimus 992 — 10y
0
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? CrazyRocker60 17 — 10y
0
Insert a Sound object using Basic Objects into a part, then change the Sound ID to the music's ID Sublimus 992 — 10y
0
Then how do you connect it to the button CrazyRocker60 17 — 10y
Ad
Log in to vote
0
Answered by
Nickoakz 231 Moderation Voter
10 years ago

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..

Log in to vote
0
Answered by 9 years ago

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)

Answer this question