I am currently using the Preload method to prevent bugs from occurring later on in my Admin Commands system in the future, however, to my surprise, it is taking along time, and I am not sure if I am using it correctly, as I have set it up to repeat waiting until the asset has Preloaded
, sadly, I can not provide any Output, as it just prints Preloading Assets..
the starting of execution, here is the code I am currently using:
print("Preloading Assets..") local Preload = {154482026,109163377,109165391,172729916,151363261,151360795,177146457,134086163,106708040,5207053,43803419,43803430,94024832,86089361,145422684,175215264,174589931,156434403,130768080,161196747,180236172,143512547,143947880,155107435,154362806,130764066,176442243,191819419,157671361,197321696,155213085} for i,v in pairs(Preload) do if game:GetService("ContentProvider") then repeat game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id="..v) wait(1/19) until game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id="..v) print("PRELOADED",v) end end print("Finished Preloading")
The preload function runs asynchronously, so you shouldn't have much of a problem.
A better way to make sure everything has loaded is to RequestQueueSize property, and wait till it gets to 0. This would also be useful if you wanted to show your user how long they need to wait for everything to load.