Hi, I was making a loading screen, and after months of making simple loading screens, I decided I wanted to learn how to display the accurate percentage of the game being loaded in a GUI. I would like to know, is there a certain function, or method you can use to achieve this?
✓ ANSWER ACCEPTED
How would I display the percentage of the game being loaded in a GUI?
1 answer
✓ Accepted answer
Based on roblox wiki, you should try to preload each asset at a time, yelding while it is loading:
-- create some sample assets
local sound = Instance.new("Sound")
sound.SoundId = "rbxassetid://301964312"
local sound2 = Instance.new("Sound")
sound2.SoundId = "rbxassetid://301964312"
-- create a table of assets to be loaded
local assets = {
sound,
sound2
}
wait(3)
for i = 1, #assets do
local asset = assets[i]
ContentProvider:PreloadAsync({asset}) -- 1 at a time, yields
local progress = i / #assets
bar.Size = UDim2.new(progress, 0, 1, 0)
end
1 comment
0
Thank you so much! I now understand it much better!
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Will the percentage be a loading bar or just numbers (50%)
You can just do the loading bar for this question's sake, the main reason im asking is so I know what the function to find the objects loading in the game.
ohh i see you can do game.Workspace:GetDescendants() and this returns all the children inside