I tried making a click button to play music but it doesn’t work here is my script
–Variables
local GoodSound = game.SoundService.GoodSound
local play = false
–script
script.Parent.MouseButton1Click:Connect(function()
if play then
GoodSound.Volume = 1
play = false
script.Parent.Text = “Mute music” else
GoodSound.Volume = 0
play = true
script.Parent.Text = “Play music”
end
end)
Try this in a local script inside your imagebutton inside your GUI, under StarterGUI:
local music = game.SoundService.GoodSound
script.Parent.MouseButton1Click:Connect(function()
if music.Volume == 0 then
music.Volume = 2
script.Parent.Text = “Play music”
else
music.Volume = 0
script.Parent.Text = “Mute music”
end
end)
If you want the music to not start right away, but be silent and only start when you click the button, then adjust “if then, else” statement accordingly.