Hi, I am making a music mute system but only sometimes the music plays even it is muted; Here’s the code:
local Button = script.Parent
local music = script.Parent.Parent.Parent.Parent.Sound
local sound = script.Parent["Game SFX | Click Sound Effect"]
Button.MouseButton1Click:Connect(function()
sound:Play()
if music.IsPlaying then
music.Playing = false
music:Pause()
script.Parent.Image = "rbxassetid://5816997299"
else
music.Playing = true
music:Resume()
script.Parent.Image = "rbxassetid://5816996037"
end
end)