I’ve added a mute music in game, now I’ve worked on so many mute music systems before but some reason it doesn’t want to work.
local ss = game:GetService("SoundService")
local sounds = ss:WaitForChild("MusicGroup"):GetChildren()
local Configuration = script:WaitForChild("SoundConfig")
local Volume = Configuration.Sound -- Value is a NumberVal and uses a decimal
local button = script.Parent
button.MouseButton1Down:Connect(function()
for i, v in pairs(sounds) do
if v:IsA("Sound") then
if v.Volume == Volume then
button.Text = "Music: Off"
v.Volume = 0 -- It makes the volume zero
else
button.Text = "Music: On"
v.Volume = Volume -- But it doesn't make it unmuted nor does the text change
end
end
end
end)