I don’t really know how to explain what I’m trying to do so I’m gonna make a little diagram.
I - The parent
I - The child inside the parent
I - The child in the child inside the parent, I want to get to this, nothing else.
Is it even possible?
I don’t really know how to explain what I’m trying to do so I’m gonna make a little diagram.
I - The parent
I - The child inside the parent
I - The child in the child inside the parent, I want to get to this, nothing else.
Is it even possible?
you have to get the descendants of the object.
instance:GetDescendants()
You can use for loops:
for i, v in ipairs(script.Parent:GetChildren()) do
for k, l in ipairs(v:GetChildren()) do
print("Wrong category")
end
end
Yes, it is very possible.
For the parent: use script.Parent
.
For the child inside the parent: use script.Parent:FindFirstChild(child name)
.
For the child in the child in the parent:
use script.Parent:FindFirstChild(child name):FindFirstChild(second child name)
.
If you need every child/descendant instead of just one, use :GetChildren()
or :GetDescendants()
instead of :FindFirstChild()
Very funny, Im gonna try this anyway, thanks for the help im gonna delete this post
script.Parent.Child.Child? is that too difficult?
You could also put them in a van but thats out of the scope of this discussion.
please reword this, i beg of you…
i was like “the hec?” until i realized children is a thing in coding
i thought it was like that games of “get eaten by X” but asking how to make it so kids join or somthing
You can just edit the category, press the pencil next to th title then change the category to scripting help
For some reason I never knew that
Yes, this is very possible.
You can get the child of an instance by just using a “.”, for example:
Script.Parent.Humanoid.Animator
would get the Animator of whatever character the script is parented to.
I would but I don’t know how, that’s just how you say it in scripting talk
‘How to loop through children within children’
They mean how to loop within both of the children.
yo, with this script you can only take one child of child.