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

Why is PreloadAsync yielding infinitly?

Asked by 5 years ago

Whenever I run my music script, the PreloadAsync() yields infinitly. No errors showed up, but a Print() function I set up never fires and the music doesn't play. (The original script had about 8 songs, but I had to shorten it to make it fit.)

01content = game:GetService("ContentProvider")
03content:PreloadAsync(music)
04while true do
05    local pick = math.random(1,table.getn(music))
06    local song = music[pick]   
07    script.Music.SoundId = song
08    script.Music:Play()
09    print("Music Playing")
10    wait(script.Music.TimeLength)
11end

1 answer

Log in to vote
0
Answered by 5 years ago

Turns out that the input in to the PreloadAsync is a table of the actual objects, not the asset ids.

Ad

Answer this question