I’ve recently been working on a system where, when you click on a mute button, it mutes every sound inside of a folder. And for some reason, the for loop that I use for muting all the sounds isn’t looping through all of the sounds. It only mutes every other sound inside of the folder. Here’s the code:
Music.MouseButton1Click:Connect(function() for _, music in pairs(script.Parent.Music:GetChildren()) do if music.Volume == 0.5 and Music.Frame.Visible == false then music.Volume = 0 Music.Frame.Visible = true else music.Volume = 0.5 Music.Frame.Visible = false end end end)
Maybe you try to put those sounds inside of a table, and connect that to your for loop.