Getting all childrens

I have couple parts in folder and inside of them there are UI’s with names of the items, and i was wondering how can i get all UI’s because usually i would use

local Billboards = script.Parent:FindFirstChildWhichIsA("BillboardGui")

But that would get only the first child, How would i get all of them?

for i, v in pairs(script.Parent:GetChildren()) do
if v:IsA("BillboardGui") then
-- code
else return;
end
end
2 Likes

Also i don’t know if you know about TopbarPlus but any idea why this doesn’t work?

local Icon = require(game:GetService("ReplicatedStorage").Icon)
local icon = Icon.new()

icon:setLabel("Show names")
icon:setTip("Show names of the items")



icon.selected:connect(function()
	for i, v in pairs(game.Workspace.Items:GetChildren()) do
		if v:IsA("TextLabel") then
			if v.Visible == false then
				v.Visible = true	
			end	
		end
	end
end)


icon.deselected:connect(function()
	for i, v in pairs(game.Workspace.Items:GetChildren()) do
		if v:IsA("TextLabel") then
			if v.Visible == true then
				v.Visible = false	
			end	
		end
	end
end)

Is it a problem with the for i part?

Is there anything showing up in your output by any chance?

I am not sure what you mean, but you would use GetDescendants() to get all of the children of the UI, including the descendants of those children.
You would use GetChildren() to get all of the children of an object in the game. GetChildren() only gets the immediate children of that object. For a visual explanation look here:

local billboards = script.Parent:GetChildren()
-- :GetChildren() is a roblox method that returns all children instances of an object in the form of an array.