Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I get the names of all children?

Asked by
Jexpler 63
6 years ago

So I'm making a gui that will display all of the pieces of a player on a surface gui. I also have it printing them. I got it to do it, but it does them individually. So the gui will display only one of them. How do I get it to either display all of them, or display each of them on different text labels? Here is my gui so far:

script.Parent.Touched:connect(function(hit)
    if hit.Parent:FindFirstChild('Humanoid') then
    local children = hit.Parent:GetChildren()
    for index, children in pairs(children) do
        print(index, children.Name)
        game.Workspace.List.SurfaceGui.Frame.TextLabel.Text = children.Name
        game.Workspace.List.SurfaceGui.Frame.TextLabel.TextSize = 5
    end
end
end)
0
children:GetChildren() line 4 or just use GetDescendants() -- gets all children greatneil80 2647 — 6y
0
So it'll get them all at once instead of in a list? Jexpler 63 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

Lunes 3 and 4. You overrode the children variable on line 3 on line 4. Name the line 4 variable "child" and change the textlabel things from children.Name to child.Name

0
That won't really help as he doesn't clone the textlabel User#20388 0 — 6y
Ad

Answer this question