so I got this mute music script and when I press the button everything works but there are 2 problems when I click it mutes everyones music and also when I reset the gui stops working how do I make this gui work all correctly

also when I die not only that the gui stops working but the image sets back alone to unmuted image even if the music has been muted before I die

Music = script.Parent.Parent.Parent.Sound
hidden = 1
function RunGui()
if hidden == 1 then 
	hidden = 2
	script.Parent.Image =  "http://www.roblox.com/asset/?id=202000937"
	Music.Volume = 0
else
	hidden = 1
	script.Parent.Image =  "http://www.roblox.com/asset/?id=202000870"
	Music.Volume = 0.4
end
end
script.Parent.MouseButton1Down:connect(RunGui)

1 comment

0

Where does “Music” lead to? Also, disable “ResetOnSpawn” in the ScreenGui. That’ll prevent your GUI from resetting once you die.