So, here's my problem: I want to make a club in one of my games that plays music in ONLY the club (Area specific music) but, while the script DOES work in playing the music and keeping it in one area, for some reason it plays multiple songs at once. Help?
Here's the script:
sounds = {144498225, 144586529, 142401311, 145068500}
for _, audio in pairs(sounds) do
game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=" .. audio)
end
for _, audio in pairs(sounds) do
for i = 1, #sounds do
local music = Instance.new("Sound", workspace.clubMusic)
music.Name = sounds[i]
music.SoundId = "http://www.roblox.com/asset/?id=" .. sounds[i]
music:Play()
print("Waiting: ".. music.TimeLength)
wait(music.TimeLength)
music:Destroy()
end
end

2 comments
Replace line 7 with "while true do", because you're going to iterate the second "for" loop only 4 times, which means the 4 songs will only be played 4 times.
Thanks, but it still has the problem where it plays multiple songs at once