Okay so I have a script that stops the music when I press a gui (Stop music button) but I would like to just set the volume to 0 instead of stopping it. Could anyone help it? This is the script I'm using
stopped = false sound = game.Workspace.Sound script.Parent.Text = "Music: ON" script.Parent.MouseButton1Down:connect(function() if stopped == true then sound:Play() stopped = false script.Parent.Text = "Music: ON" else sound:Pause() stopped = true script.Parent.Text = "Music: OFF" end end)
this should work
local stopped = false local sound = game.Workspace.Sound -- i just put local cuz im used to makeing local variables script.Parent.Text = "Music: ON" script.Parent.MouseButton1Down:connect(function() if stopped == true then sound.Volume = .5 -- grab the volume property and set to .5 or however high you want it stopped = false script.Parent.Text = "Music: ON" else sound.Volume = 0 -- grab the volume property and set to 0 stopped = true script.Parent.Text = "Music: OFF" end end)