Studio 4.896 2.168 4.896
Test0 0 0
wait(10) music = script:GetChildren() a = true while a == true do wait(1) a = false for i,v in pairs(music) do local MusicRandom = music[math.random(1,#music)] MusicRandom:Play() if music[i].IsPlaying then print(music[i].TimeLength) wait(music[i].TimeLength) a = true end end end
wait(10) music = script:GetChildren() while wait(1) do local MusicRandom = music[math.random(1,#music)] MusicRandom:Play() if MusicRandom.IsPlaying then --use MusicRandom instead of music[i] because music[i] isnt the randomly selected music piece. print(MusicRandom.TimeLength) wait(MusicRandom.TimeLength) end end --the variable 'a' seemed useless in this problem so I toke it out if you don't mind
Try that.