Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

When I run this in game it stops halfway through the first song, can someone help me?

Asked by 7 years ago
01local S1 = Instance.new("Sound")
02    S1.Name = "Music"
04    S1.Parent = game.Workspace
05local S2 = Instance.new("Sound")
06    S2.Name = "Music"
08    S2.Parent = game.Workspace
09local S3 = Instance.new("Sound")
10    S3.Name = "Music"
12    S3.Parent = game.Workspace
13 
14local S4 = Instance.new("Sound")
15    S4.Name = "Music"
View all 42 lines...

1 answer

Log in to vote
0
Answered by
cabbler 1942 Moderation Voter
7 years ago

This is really easy to test and it works fine. Needs some organization. Always loop!

01local ids = {154988842,181462247,181462282,181462320,181462345}
02 
03local sounds = {}
04 
05for _,id in ipairs(ids) do
06    local new = Instance.new("Sound")
07    new.SoundId = "http://www.roblox.com/asset/?id="..id
08    new.Parent = workspace
09    table.insert(sounds,new)
10end
11 
12while wait() do
13    for _,s in ipairs(sounds) do
14        if not s.IsLoaded then s.Loaded:wait() end
15        s:Play()
16        s.Ended:wait()
17    end
18end
Ad

Answer this question