How can I make a script that changes a text based off the number of assets loaded like? "4/778"

How can I make a script that checks all assets in the game and loads them like those loading screens were they display the numbers of assets loaded?
4/778 assets loaded

1 Like

maybe you could use game:GetService(“Workspace”).DescendantAdded event? every time an asset is added to the workspace you update the loading screen

1 Like

Also make sure to account for the Assets that were already loaded before the script.

local Workspace = game:GetService("Workspace")
local NumberOfInstancesInWorkspace = script.NumberValue

local UpdateNumber = function()
	
	NumberOfInstancesInWorkspace.Value += 1
	
end

-- By doing this, any Instance that were added to Workspace before this script ran are also added into the number
for i,v in ipairs(Workspace:GetDescendants()) do
	
	UpdateNumber()
	
end

Workspace.DescendantAdded:Connect(UpdateNumber)
1 Like

use ContentProvider:PreloadAsync

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.