What’s the difference between:
1- workspace:GetChildren()
and
2- for i, v in pairs(workspace:GetChildren()) do
Don’t both loop through all the workspace children?
What’s the difference between:
1- workspace:GetChildren()
and
2- for i, v in pairs(workspace:GetChildren()) do
Don’t both loop through all the workspace children?
workspace:GetChildren()
returns a table with all the elements parented under workspace.
However:
for i, v in pairs(workspace:GetChildren()) do
-- etc.
end
This allows you to loop through each of the children within the table and do something with them.
For example:
for i, v in pairs(workspace:GetChildren()) do
v:Destroy()
end
This would delete all children of workspace.
Aha I get it now!
Thank you so much!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.