So I am trying to make that when the player clicks on "PLAY" Button then destroy/stop audio but it isn't working. Here is the script.
game.StarterGui.Menu.PLAY.MouseButton1Click:connect(function() workspace.Sound:Destroy() end)
Here's a Script I made just now, it should hopefully work, ( Has not been tested tho )
It must be a local script in the button that it will pause it on.
local music = game.Workspace.Music -- Name the sound "Music" script.Parent.MouseButton1Click:Connect(function() if music.Volume == 0 then music.Volume = 1 else music.Volume = 0 end end)
So The Problem Is That You Don't Destroy The Music You Stop It. Try This:
game.StarterGui.Menu.PLAY.MouseButton1Click:connect(function() workspace.Sound:Stop() end)
And If You Want to Play It Once Again Do this
game.StarterGui.Menu.PLAY.MouseButton1Click:connect(function() workspace.Sound:Play() end)