I searched up many forums about it but I just dont get it. If waitfirstchild is just going to find the child if it exists and findfirstchild is just going to find the child if it exists as well then what is the difference. I know that findfirstchild is instantly going to find the child but waitfirstchild is still also going to find the child instantly if it exists as well. Does anybody know the difference? Please help.
What is the difference between waitfirstchild and findfirstchild?
2 answers
:WaitForChild("Part") is for waiting for a part mostly to load:FindFirstChild("Part")for example if you have in workspace 2 parts that are have similar names when you say:FindFirstChild("Part") it will find the first part that has this name
Also its very usfull cause if it finds the part it returns "true" and if the part dosnt exsist it return "false"
so if you are using :FindFirstChild() you can put it in a if statement
Exsample:
if game.Workspace:FindFirstChild("Part")then
print(game.Workspace.Part.Name)
else
print("No part in workspace called part")
end
Hello, RebornedSnoop!
Both of them are used to find a child of an Instance.
The only difference is that WaitForChild waits for the Child to be created, so it don't errors(but may cause infinite wait warnings), while FindFirstChild tryes to match only the existing childs, and may cause errors if the part you're trying to find don't exists
5 comments
So waitforchild is literally findfirstchild but waits?
yes
no
RebornedSnoop read my answer and you might understand
ok thanks sorry but only can accept one
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
FindFirstChild does not return a boolean but the instance of the part.