Loading game as assets

InsertService has the function LoadAsset, it uses the id of the asset.

game:GetService("InsertService"):LoadAsset(id)

The Instance it returns is the asset.

Advisory warning that you should not be using RequestQueueSize for loading screens. RequestQueueSize is a dynamic property which determines how many assets are left in the download queue. This can result in long loading screens which is absolutely horrid for UX. You shouldn’t be waiting for your whole game to load either before players can play: let downloads stream in the background.

What you should be doing when it comes to loading screens is setting up the client-side and loading only assets you need seen immediately. You can accomplish this by use of the function ContentProvider.PreloadAsync. This puts assets into the download queue if not already present and pushes all the assets you specify to the front of the queue to be downloaded first.

:thinking:

The script from the link you sent is it local script? Where do I put it?

ContentProvider can only be used from the client-side. If you want to prioritise assets during client initialisation, put it in ReplicatedFirst. If you want to prioritise assets after the server has replicated the DataModel to the client, use an appropriate client-side container to work things out.