local Songs = game.Workspace.Songs:GetChildren()
local MuteButton = game.StarterGui.MuteButton.SpectateButton.Spectate
local MuteText = game.StarterGui.MuteButton.SpectateButton.Spectate
MuteButton.MouseButton1Click:Connect(function()
print("what")
if MuteText.Text == "Mute" then
for i = 1, #Songs do
local Song = Songs[i]
Song.Volume = 0
end
MuteText.Text = "Unmute"
else
for i = 1, #Songs do
local Song = Songs[i]
Song.Volume = 0.5
end
MuteText.Text = "Mute"
end
end)
while true do
for i = 1, #Songs do
local Song = Songs[i]
Song:Play()
wait(Song.TimeLength)
Song:Stop()
end
end
I’m trying to make a music player and a gui to mute the audio. The problem is that the gui isn’t muting the audio when clicked on. I tried checking the properties of the gui to see if it was inactive, but everything was good.
Did you forget to add the Play() function? Edit: It still doesn’t work for some reason when I changed the property of the sound to be playing and looped. I’m starting to believe it is something to do with the gui.