Infinite yield possible

I want to fix these errors in output

  • These errors are within CoreGui I have no idea how to fix.
    1.image
    2.image
    ========================
  • This error is within Players
    1.image
    ========================
  • This in Replicated Sotrage
    1.image
    ========================
    There are some things I need to know in short:
    – How does this Infinite yield possible error affects on game?
    – How can we reduce the chances of having this error?
    ========================
    If there is anything you need to help me with this please let me know I can provide everything and thank you in advance :))
3 Likes

There is nothing you can do, it’s from Roblox’s script. It probably doesn’t have any effect on the game anyways.

1 Like

As long as the infinite yields aren’t permanent you should be fine. It just means that Roblox Studio thinks that the loop is recurring too much.

Yeah its not permanent I think, sometimes I see more similar errors and they often poof and then comes back sometimes.

Hey! I know I’m a bit late and the topic has already been solved, but you can actually add a time out to a WaitForChild(). That will prevent this warning from appearing whenever the expected child has not been found within the automatically set time frame. Here’s an example:

script:WaitForChild("HDAdminSetup", 60) -- You can change this number to anything. Using math.huge will basically be the default max waiting time for WaitForChild(), but strangely silences the warning message shown in your screenshot.
1 Like

Wow that’s really an nice suggestion, also could u tell me what amount of timeout is suggested? It it depends totally on how many times the script needs to wait for the child right?

I believe after 10 or 15 seconds you will receive this warning in the output. The WaitForChild() bit will only be ran one time unless a task.spawn function is used. Otherwise, it will stop the rest of the code from running until the child is found. If the child is never found however, the rest of the code will never run. So, adding your own timeout is recommended. For Instances that I’m pretty confident will be there, I usually put 1 second in the timeout part. For Instances that I’m not so confident about, I put at least 30 seconds or more.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.