Answers for "how to get the children count in roblox"

7

get children roblox

local children = workspace:GetChildren()
for i = 1, #children do
    print(i, children[i].Name)
end
Posted by: Guest on May-07-2020
3

get children roblox

--[[
	instance
		child_1
			child_1_1
		child_2
		child_3
			child_3_1
]]

local children = instance:GetChildren()
print(children) --[[ prints:
	{
		[1] = child_1,
		[2] = child_2,
		[3] = child_3
	}
]]

local descendants = instance:GetDescendants()
print(descendants) --[[ prints:
	{
		[1] = child_1,
		[2] = child_1_1,
		[3] = child_2,
		[4] = child_3,
		[5] = child_3_1
	}
]]
Posted by: Guest on July-21-2021

Code answers related to "how to get the children count in roblox"

Browse Popular Code Answers by Language