local music = game.Workspace.Music -- Name the sound "Music" script.Parent.MouseButton1Click:Connect(function() if music.Volume == 0 then music.Volume = 0.1 else music.Volume = 0 end end)
Better option: local music = game.Workspace.Cradle -- Name the sound "Music" local textButton = script.Parent local muted = false textButton.MouseButton1Click:Connect(function() muted = not muted -- Toggle the muted state if muted then music.Volume = 0 textButton.Text = "Unmute" else music.Volume = 0.5 textButton.Text = "Mute" end end)