Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to use the timeOut argument in WaitForChild()?

Hello, I am making a script that uses the "require" statement to get an object reference from a ModuleScript which uses WaitForChild(). When I hit the debug switch, I get a warning telling me that I have an infinite yield. I previously asked a question about what an infinite yield is, and the answer I was given told me that I needed to use the timeOut argument, but I was given a vague explanation of the timeOut argument. I went to look it up on the ROBLOX Wiki, and the timeOut argument wasn't explained very well. Can you give an example of code using the timeOut argument?

2 answers

The new TimeOut argument of the WaitForChild method defines the maximum time (In seconds) that it should wait for the child before resuming the thread and returning nil

This discussion is preserved as it was. New answers, comments, and votes are closed.