I'm trying to make a loading screen that checks for every asset in the game, and I mean every single instance. How would I do that?
If you can also figure out how to make: -the total amount of assets as a variable, -the current amount of loaded assets as a variable, I'd greatly appreciate that!
EDIT 1: I tried something, and I got an error.
Error:
10:17:34.271 - The current identity (2) cannot Class security check (lacking permission 6) 10:17:34.272 - Stack Begin 10:17:34.272 - Script 'Players.Maxis_s.PlayerGui.loadingGUI.bg.loadingText.LocalScript', Line 6 10:17:34.272 - Stack End
Code:
local text = script.Parent local gameAssets = game:GetDescendants() local CP = game:GetService("ContentProvider") for i = 1, #gameAssets do text.Text = "Loading Asset "..tostring(gameAssets[i]).."/"..tostring(#gameAssets) CP:PreloadAsync({gameAssets[i]}) end text.Text = "Loading Complete! Joining game..."
EDIT 2: I have fixed the issue, and the script now works.
Script (for anyone who wants it):
local text = script.Parent local gameAssets = game:GetDescendants() local CP = game:GetService("ContentProvider") for i = 1, #gameAssets do text.Text = "Loading Asset "..tostring(i).."/"..tostring(#gameAssets) CP:PreloadAsync({gameAssets[i]}) end text.Text = "Loading Complete! Joining game..." --Insert removal code here