I'm making a loading screen that loops through everything in the game and preloads it.
for i, thing in pairs(game:GetDescendants()) do
game.ContentProvider:PreloadAsync(thing)
print("loading.." .. thing.Name)
end
print("Done")
I'm making a loading screen that loops through everything in the game and preloads it.
for i, thing in pairs(game:GetDescendants()) do
game.ContentProvider:PreloadAsync(thing)
print("loading.." .. thing.Name)
end
print("Done")
You don't need a generic loop in order to use PreloadAsync. You just need to give it a table, for example, game:GetService('ContentProvider'):PreloadAsync(game:GetDescendants()).
A cleaner example would be something like:
game:GetService('ContentProvider'):PreloadAsync({workspace.Decal, workspace.OtherDecal});
repeat until game:GetService('ContentProvider'):GetPropertyChangedSignal("RequestQueueSize"):Wait() <= 0
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
I'm pretty sure that you have to use a table, game:GetService("ContentProvider"):PreloadAsync({thing})