Here, I have a way better solution -- you don't have to delete anything!
03 | local Songs = game.Workspace.Songs |
05 | local function songs () |
07 | Songs.DarudeSand:Play() |
09 | Songs.Bangarang:Play() |
19 | script.Parent.Parent.StarterGui.ShopAct.Frame.ImageButton.MouseButton 1 Click:Connect( function () |
20 | if debounce = = false then |
24 | elseif play = = false then |
27 | for i,v in pairs (Songs:GetChildren()) |
28 | if v:IsA( "Sound" ) then |
31 | elseif play = = true then |
I simply defined a boolean value that can be set to true or false judging by the button press, a debounce is added so it isn't constantly changing the value.
Once the "if" statements decide whether to be false or true, it then does a loop of the Songs folder/model and checks if a certain member of the model (v) is a sound. Once it figures that out, it pauses or resumes it judging by whether play is false or true.
Although, if you want, I do have a huge module script that you could use to play your songs alternatively instead of ":Play()"
https://forum.scriptinghelpers.org/topic/725/cvextra-super-module-script
MODULE SCRIPT: https://www.roblox.com/library/2674126390/CVExtra-Super-Module-Script
A remade form using my script (THIS ASSUMES YOU PUT THE MODULE SCRIPT IN THE WORKSPACE):
03 | local Songs = game.Workspace:FindFirstChild( "Songs" ) |
04 | local CVExtra = game.Workspace:FindFirstChild( "CVExtra" ) |
05 | local playAudio = CVExtra.playAudio |
07 | local function songs () |
09 | playAudio(Songs.DarudeSand) |
11 | playAudio(Songs.Bangarang) |
15 | playAudio(Songs.Poison) |
21 | script.Parent.Parent.StarterGui.ShopAct.Frame.ImageButton.MouseButton 1 Click:Connect( function () |
22 | if debounce = = false then |
26 | elseif play = = false then |
29 | for i,v in pairs (Songs:GetChildren()) |
30 | if v:IsA( "Sound" ) then |
33 | elseif play = = true then |
Do not worry about doing a whole wait of the song's length, my module script has that all done for you, and it'll wait if the audio gets paused.