If you want to get every single object in the workspace, then I suggest this:
local ObjectTable = {}
function GetObjects(Area)
for _,Obj in pairs(Area:GetChildren() do
table.insert(ObjectTable,Obj)
GetObjects(Obj)
end
end
GetObjects(game.Workspace)
This will make table ObjectTable contain every single object in the workspace. However, if you wanted every PART in the workspace, then you would slightly modify the script, like so:
local ObjectTable = {}
function GetObjects(Area)
for _,Obj in pairs(Area:GetChildren() do
if Obj:IsA("BasePart") then
table.insert(ObjectTable,Obj)
end
GetObjects(Obj)
end
end
GetObjects(game.Workspace)
Hope this helped!
1 comment
This is not a request site, please post your attempted script.