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

How would I use the second parameter of Instance:FindFirstChild (recursive)?

Asked by 5 years ago

I've recently discovered a second parameter of Instance:FindFirstChild, recursive. How would I use it? The wiki doesn't provide an example with recursive.

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Basically it functions as a :FindFirstDescendant() (if that were a thing); it will check the children, the children's children, and so on.

An example would be:

print(game:FindFirstChild("StarterCharacterScripts", false)) -- nil
print(game:FindFirstChild("StarterCharacterScripts", true)) -- StarterCharacterScripts
Ad

Answer this question