You can use ContentProvider Service and it’s function :PreloadAsync() probably
By that, I mean you can loop until all of the assets are ready, and then it triggeres the main code
You should not use wait() as it is not accurate, be sure to use task.wait(). If that does not work, you can just manually wait a reasonable amount of time before running that script.
Can you give me an example because what I need to accomplish is to use preloadAsync to check if workspace has loaded, I haven’t been able to find anything on using content provider to wait until workspace has loaded.
contentProvider = game:GetService("ContentProvider")
assets = game.Workspace:GetDescendants()
for i, v in pairs(assets) do
contentProvider:PreloadAsync({v})
end
Yes it will. :PreloadAsync() loads the asset given, and for i, v in pairs loops through all of the instances in a table. And game.Workpace:GetDescendants() returns a table
This is what I found online, It looks like the exact same except you might need to fire an event to enable a bool value if you want it for server side, not sure this tends to only be used for when doing loading screens and I dread doing them but I just know it should work if you experiment with it.