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

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).
