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

Is there a way to make :WaitForChild() wait for a certain amount of time, then stop?

I was wondering if it were possible to make :WaitForChild() wait for a certain amount of time, and if it's still nil, it'll break like a loop would / stop.

1 comment

0

wait(1)

1 answer

✓ Accepted answer

ROBLOX has recently updated the function so that if :WaitForChild() exceeds five seconds without returning anything, then a warning will be printed out to the output.

You can set a certain amount of time to the function. The parameters for the function are string childName, double timeOut. The second parameter, timeOut, does default to 0 by the way.

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