I don't know how to change it to where if you click on it again it will stop the music. Help D:
function Clicked() game.Workspace.SurfacePart.Songs.Song1:Play() end script.Parent.MouseButton1Down:connect(Clicked)
I hate that 1.5 minute cooldown -_-
local playing=false function Clicked() if not playing then game.Workspace.SurfacePart.Songs.Song1:Play() elseif playing then game.Workspace.SurfacePart.Songs.Song1:Pause() --Change this to :Stop() if you want end script.Parent.MouseButton1Down:connect(Clicked)
Lol I really don't know how to make a short script on how to stop it but this is what I did and it stopped songs for me
PLAY
function Clicked() local song = game.Workspace.MUSIC:Clone() song.Parent = game.Workspace song.Name = "CLONENAME" game.Workspace.CLONENAME:Play() end script.Parent.MouseButton1Down:connect(Clicked)
END
function Clicked2() game.Workspace.CLONENAME:Destroy() end script.Parent.MouseButton1Down:connect(Clicked2)
I think this'll work;
wait(0) gui=script.Parent.Parent:FindFirstChild("Sound") script.Parent.MouseButton1Down:connect(function() if gui~=nil then if gui.IsPlaying then gui:Stop() elseif not gui.IsPlaying then gui:Play() end end)