So i have this image mute button within a GUI and i have a local script within that image mute button and everytime i mute it in game and i die it will go back to un-muted but you wont here the sounds / music playing. Now im trying to define the players health and do i check to see when that player dies it will go from muted or unmuted etc.
any ideas?
local muteButton = script.Parent local musicFolder = game.ReplicatedStorage.BackgroundMusic local currentTrack = game.ReplicatedStorage.CurrentTrack local muted = false muteButton.MouseButton1Click:Connect(function() if currentTrack.Value ~= "..." then local nowPlaying = musicFolder[currentTrack.Value] nowPlaying.Volume = muted and 0.3 or 0 muteButton.Image = muted and "rbxassetid://176572847" or "rbxassetid://176572748" muted = not muted end end) currentTrack:GetPropertyChangedSignal("Value"):Connect(function() if currentTrack.Value ~= "..." then local nowPlaying = musicFolder[currentTrack.Value] if muted == true then nowPlaying.Volume = 0 elseif muted == false then nowPlaying.Volume = 0.3 end end end)