My music script is playing multiple songs at a time. Help?
Asked by
7 years ago Edited 7 years ago
My old music script that played Christmas songs is playing multiple songs at a time. How do I prevent / fix this?
02 | local musicholder = script.Parent |
03 | math.randomseed(tick()); |
06 | musicholder:WaitForChild( 'CW' ), |
07 | musicholder:WaitForChild( 'DeckDubstep' ), |
08 | musicholder:WaitForChild( 'EhDe' ), |
09 | musicholder:WaitForChild( 'JayKode' ), |
10 | musicholder:WaitForChild( 'Ookay' ), |
11 | musicholder:WaitForChild( 'SantaComes' ), |
12 | musicholder:WaitForChild( 'XmasToMe' ), |
13 | musicholder:WaitForChild( 'XmasBeats' ), |
19 | local songCount = #songList |
24 | local songNum = math.random( 1 , songCount) |
26 | if played [ songNum ] then |
27 | repeat songNum = math.random(songCount) until not played [ songNum ] ; |
30 | played [ songNum ] = true ; |
31 | if #played = = songCount then |
36 | songList [ songNum ] :Play() |
37 | songList [ songNum ] .Ended:Wait() |