I’m trying to create a nostalgic loading screen that was featured back in the old days and within the Roblox event “The Classic”. This screen will display the assets’ names loading, mimicking how it used to show basic terms like “Bricks” and “Connectors.”
Although it is possible to create a simple GUI and remove the default loading screen through scripts, I don’t know how to print how many assets were loaded as “Bricks” and I suppose scripts as “Connectors” (I could be wrong as I don’t know its true meaning).
Is there a way to achieve this effect through UI elements and LocalScripts within ScreenGui? Any help in recreating this retro loading screen experience would be greatly appreciated!
you can display the assets loaded with the following script
game.ReplicatedStorage:RemoveDefaultLoadingScreen() -- remove the default roblox loading screen
local ContentProvider = game:GetService("ContentProvider")
local assets = game:GetDescendants()
for i = 1, #assets do -- for every 1 out of the number of assets run this loop
local asset = assets[i] -- get the asset that you are looping through
local percentage = math.round(i/#assets*100) --convert the amount of assets you have already loaded into a percent
contentProvider:PreloadAsync({asset}) --preload the asset
print(i .. "/" .. #assets .. "\n" .. precentage .. "%") -- display the amount currently loaded
-- or you could just display the amount of assets you currently have loaded
if asset:IsA("Script") or asset:IsA("LocalScript") then
script.Parent.Connectors.Text = i
elseif asset:IsA("BasePart") then
script.Parent.Bricks.Text = i
end
end
hopefully this solves your problem, in summary: we are using contentprovider service to preload assets and we are using game:GetDescendants() to get the assets that we have to load.
i tried to label everything i scripted to the best of my ability
Wouldn’t setting the text to “i” cause them to just show the index? Surely you’d need a counter and increment it whenever a basepart/script is detected.
I took some analysis and review from the code and needed to revamp a bit because some errors were printing on the Output tab/Developer Console. For instance: ReplicatedStorage:RemoveDefaultLoadingScreen() is not a real member – It should’ve been ReplicatedFirst.
But, overall, here is the new version:
--[Services]--
local ReplicatedFirst = game:GetService("ReplicatedFirst")
local ContentProvider = game:GetService("ContentProvider")
--[All Assets]--
local assets = game:GetDescendants() -- Get all descendants of the script (might be inefficient)
--[Loop to Load Assets]--
for i, asset in ipairs(assets) do -- Use ipairs for cleaner indexing
local percentage = math.round(i / #assets * 100) -- Calculate percentage loaded
-- Preload the asset
ContentProvider:PreloadAsync({asset})
-- Display loading progress (modify as needed)
print(i .. "/" .. #assets .. "\n" .. percentage .. "%")
-- Optionally categorize loaded assets (improve based on your needs)
if asset:IsA("Script") or asset:IsA("LocalScript") then
script.Parent.Connectors.Text = i -- Update "Connectors" TextLabel with loaded script count
elseif asset:IsA("BasePart") then
script.Parent.Bricks.Text = i -- Update "Bricks" TextLabel with loaded part count
end
end
Although it works, I believe only the thing missing is how to print the “Bricks” and "Connectors on the script.Parent.Connectors.Text and script.Parent.BricksText.
i shows the index, but on the script, it prints the increment and counts how much BasePart and scripts were loaded in-game. Not entirely sure if that’s what you mean. Please, correct me if you were talking about something else that I comprehend something entirely different!
Yes, it does show the index of the asset table. But as you loop through each asset i automatically updates to plus one. Index goes up as you loop through. You will need two seperate counters for each script and part though.
You can make two variables to count each script and each part seperately. Inside your if statements that check what the asset is, you can simply just set the corresponding variable to += 1 and then update the text label with the variable.
Been looking for something similar! if you manage to get it working can you make it free/share with me??? if not I totally get it but this would take my classic games to the next level