Hello! I’m trying to make a script that pre loads all the assets in my game before a black screen fades out. I’ve made this script that should load all the assets:
local TweenService = game:GetService("TweenService")
local ContentProvider = game:GetService("ContentProvider")
local BG = script.Parent.BG
spawn(function()
ContentProvider:PreloadAsync({
game:GetService("Workspace"),
game:GetService("Lighting")
})
end)
The problem is that at first, I don’t know if this script works and how could I make my “BG” disappears after everything is loaded?
ContentProvider.RequestQueueSize returns the amount of assets needed to be loaded. You could use a for loop that increases an integer every time it looped through an asset.