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

Explanation of :FindFirstChild please?

Asked by 9 years ago

What does :FindFirstChild mean?

0
do u know english? FIND FIRST CHILD. BielNS 40 — 5y
0
i was literally 8 or 9, and why are you posting this 5 years later iluvmaths1123 198 — 4y

3 answers

Log in to vote
4
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
9 years ago

FindFirstChild identifies the "first" child (or descendant if the optional second argument is specified as true) which has the name given in the parameter.

Wiki article on FindFirstChild

The "first" doesn't really mean anything useful; as long as there is only one such child (or descendant*) with that name, it will return that child.

If there is not such object with that name, FindFirstChild returns nil. This can be contrasted with simple indexing using .name or ["name"] which will trigger an error. Therefore if you are unsure whether or not a child may exist in an object, you should use FindFirstChild so that errors will not occur.

print(
    game:FindFirstChild("Workspace") == game.Workspace
);
-- true
0
Very Good Explaining!The other two awnsers are just links to explain! 10/10! iluvmaths1123 198 — 9y
Ad
Log in to vote
-2
Log in to vote
-4
Answered by 9 years ago

http://wiki.roblox.com/index.php?title=FindFirstChild_(Function)

Answer this question