I want to have button which mutes all sound in the game.
You should design a game using SoundGroups as it will allow you to mute the groups you want ie music, sfx and other channels.
It is best to handle the sound correctly when it is added into your game by setting a sound group for it.
You can do this with a script but you would not know the original volume of the sound as you cannot simply stop all music due to a lot of scripts needing to play sound is the character died.
A basic approach would be to get a list of all sound instances and set the volutme to 0 then connect an event to set all new sound instances volume to 0 as well
for _, itm in pairs(game:GetDescendants()) -- i am unsure the locations of where sound can be played so I will simple mute all sounds. -- you can do your own testing to find where sounds play if itm:IsA('Sound') then itm.Volume = 0 end end -- mute all other sound added to the game game.DescendantAdded:Connect(function(ins) if ins:IsA('Sound') then ins.Volume = 0 end end)
I hope this helps. You will need to look at which method is best for you.