How can I get :GetChildren() to only get children of a certain classname?

How can I get :GetChildren() to only get children of a certain classname such as a Frame and not a UIListLayout?

2 Likes

Just iterate through the table given and make an if statement.

You can use the IsA() function to identify if a part is a certain class for example you can do:

for _, object in ipairs(item:GetChildren())  do
  if object:IsA("Frame") then
    -- do whatever
  end
end
10 Likes

why do this?
you know it is an instance if :GetChildren() works on the parent