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)
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)
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
What this does, is if the music volume is at 0. then it will turn it to 1.. else so basicly if it is on 1 it will turn it to 0.
Thank you very much!