So im and referencing stuff for my custom chat and i have these variables ~~~~~~~~~~~~~~~~~ local Chat = script.Parent:WaitForChild("Chat") local list = Chat:WaitForChild("List")
Everything is named correctly i am sure of it but when i take of wait for child like this
local Chat = script.Parent:WaitForChild("Chat") local list = Chat.List ~~~~~~~~~~~~~~~~~ The output then says there is nothing called List in the Chat
It works in studio sometimes printing the infinite yield thing but it works most times yet on roblox it never works and outputs an error.
That means the thing you are waiting for isn't there and meaning it's possible it will be waiting for infinitley.
According to the roblox api reference manual, Infinite Yield Possible warning happens when:
a call to this function exceeds 5 seconds without returning, and no timeOut parameter has been specified, a warning will be printed to the output that the thread may yield indefinitely; this warning takes the form Infinite yield possible on X:WaitForChild("Y") , where X is the parent name and Y is the child object name.
so to stop it from giving this warning and wait forever, add a timeOut parameter, like this:
X:WaitForChild("Y",100) -- 100 is the timeOut parameter. with this, the waitforchild function will be capped at 100 seconds instead of inf seconds (without the timeout parameter).