#Make player wait with a loading screen until everything loads in

9 messages · Page 1 of 1 (latest)

rustic star
#

its easy to google

#
local contentToLoad = {table.unpack(game.ReplicatedStorage:GetDescendants()), table.unpack(game.StarterGui:GetChildren())}

local loadedCount = 0

task.wait(1)
contentProvider:PreloadAsync(contentToLoad, function(id, success)
    loadedCount = math.clamp(loadedCount + 1, 0, contentProvider.RequestQueueSize + loadedCount)
    loadinScreen.Bar.Frame.Size = UDim2.fromScale(loadedCount / (contentProvider.RequestQueueSize + loadedCount), 1)
end)
#

copied from my own script cuz im lazy af

slender timber
rustic star
#

contentProvider:PreloadAsync

#

yields your script

#

until stuff is loaded

#

so its like

#
print("before loading")
contentProvider:PreloadAsync(stuff, func) -- Loading stuff
print("after loading") -- some seconds passed, around 1-2