Loading Screen Doesn't Match Game Contents

I have a script that acts as a loading screen. The problem is that the line that makes the loading screen show how many parts there are seems to be inaccurate? I have a plugin that detects viruses, and it says that there’s over 50K parts, but the script only detects 1K.

This is the part of the script that loads it. There’s more after it, but it’s mostly unrelated stuff, and happens after this part.

local R = game:GetService("ReplicatedFirst")
R:RemoveDefaultLoadingScreen()
local ContentProvider = game:GetService("ContentProvider")
local player = game.Players.LocalPlayer 
local Ui = player.PlayerGui 
local loadingUi = script.LoadingGui:Clone() 
loadingUi.Parent = Ui 
local Parts = game:GetDescendants() --The parts
local Allparts = #Parts --The number of parts
local line = loadingUi:WaitForChild("Line")
for i, part in Parts do 
	ContentProvider:PreloadAsync({part}) 
	local e = i/Allparts 
	line.Value = math.round(e*100) .."%" .." ("..i.."/"..Allparts..")" --This is the line that shows the amount of parts loaded. Another script reads and converts this because the game sometimes can't find the text label (unrelated)
end 

Screenshot 2025-08-24 093052

Is there a way to get the latter of the parts, or is the plugin wrong? It matters at least a little bit since there’s a lot of lag (either from the abundance of parts, a virus, or a memory leak).

It’s likely that the plugin’s security lets it view more DataModel descendants.

As an example, try running print(game:GetService("PluginGuiService"):GetDescendants()) in any game script. The service is nil, so it errors. If I execute that in the Studio command bar, I get 382 instances.

I believe it has something to do with ServiceVisibilityService but that’s Roblox Security’ed

I would just use workspace:GetDescendants() personally, if you have lag elsewhere then that needs to be independently investigated.

Okay, I’ll do that instead. Thanks!

1 Like

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