Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is PreloadAsync yielding infinitly?

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.)

content = game:GetService("ContentProvider")
music = {"rbxassetid://1581067887","rbxassetid://553600220"}
content:PreloadAsync(music)
while true do
	local pick = math.random(1,table.getn(music))
	local song = music[pick]	
	script.Music.SoundId = song
	script.Music:Play()
	print("Music Playing")
	wait(script.Music.TimeLength)
end

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.