How do you make a script that sees how many parts there are in the game?

So, how do you make a script that sees how many parts there are in the game or do I have to do it manually? And is this even a thing? Any help would be appreciated!

You could just put this in the console at the bottom but if you want to make a script tthats fine

local count = 0

for i,v in pairs(game:GetDescendants()) do
   if v:IsA("BasePart") then
    count += 1
   end
end

print("There are "..count.." parts")

This is the ENTIRE game, if u wanna see how much there are in just the workspace then replace game with game.Workspace

1 Like

Thanks for the reply! You really helped me a lot!

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