How would you use a script to count children in let's say Workspace?
Of course.
We can get the list of children of the workspace simply:
local children = workspace:GetChildren();
Since children
is a table, we can get its length using the #
operator:
local children = workspace:GetChildren(); local numberOfChildren = #children; -- How many things are children, -- the length of the list of children
Well, you'd use getchildren, which returns a table.
NumberOfChildren = #game.Workspace:GetChildren()