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

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

Asked by
StoIid 364 Moderation Voter
8 years ago

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.

0
wait(1) FiredDusk 1466 — 8y

1 answer

Log in to vote
1
Answered by 8 years ago

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.

Ad

Answer this question