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

What is the meaning of "Infinite yield possible"?

Asked by 5 years ago

Please help, i dont know what this means.. :/

1 answer

Log in to vote
0
Answered by
Rare_tendo 3000 Moderation Voter Community Moderator
5 years ago
Edited 5 years ago

'An infinite yield is possible' is a warning that warns you that a script might wait infinitely for an instance that has either been not created or parented somewhere else.

This will happen if WaitForChild exceeds 5 seconds, without the timeOut parameter specified, and hasn't returned anything.

You can stop this by using WaitForChild's timeOut parameter, which will terminate the yield and return nil when its time has been exceeded.

-- Example

local p = script.Parent:WaitForChild('AnInstance, 10) -- This will try to find 'AnInstance' in the script's parent. If it couldn't find it after 10 seconds has been exceeded, waitForChild will terminate the yield and return nil
0
alright, got it chexyalani thanks for the help! :D xXAnimeIsRealLolXx 24 — 5y
Ad

Answer this question