getinstances
Returns every instance the client currently holds a reference to, including those outside the DataModel.
Signature
getinstances(): { Instance }Returns
{ Instance }
Example
local parts = 0
for _, instance in getinstances() do
if instance:IsA("BasePart") then
parts += 1
end
end
print(parts, "parts are loaded")