I was wondering if there was a way to find all parts, regardless if they are in models or not. I know you can do this:
local Model = nil
for i, v in pairs(Workspace:GetChildren()) do
if v:IsA("BasePart") then
print(v.Name)
elseif v:IsA("Model") then
Model = v
for i, v in pairs(Model:GetChildren()) do
if v:IsA("BasePart") then
print(v.Name)
elseif v:Isa("Model") then
--and so on and so forth
end
end
end
end
I just want to know if there is a simpler way to do this.

1 comment
You can create a function to use :GetChildren() on any models you encounter and have the function return if there are any models in that list. then you can just repeat the function until there are no more models.