Infinite Yield on ChatServiceRunner

local ServerScriptService = game:GetService("ServerScriptService")
local module = require(ServerScriptService:WaitForChild("ChatServiceRunner").ChatService)

Error:
Infinite yield possible on ‘ServerScriptService:WaitForChild(“ChatServiceRunner”)’

I do not understand why this is happening.

This happens cause a waitForChild can wait forever until the child is there, therefore yielding the rest of the code, to fix this you need to set the second argument that tells how long TOTAL it can wait:

-- new code
local ServerScriptService = game:GetService("ServerScriptService")
local module = require(ServerScriptService:WaitForChild("ChatServiceRunner",30).ChatService)

No, but I want it to get the ChatServiceRunner, it’s supposed to require the ChatServiceRunner for my script to work.

Try putting the module in ReplicatedStorage. Are you sure that ChatServiceRunner exists at runtime?

The module isn’t existing, I didn’t create it, but I would like to do this:

Is TextChatService.ChatVersion set to Legacy? It has to be legacy for the legacy chat (including the scripts in ServerScriptService) to be created

1 Like

No, how do I do this?
eeeeeeeee

Set the ChatVersion property of TextChatService to Legacy in the explorer.

1 Like

Ok well thats what this will do, if you put a high enough number it should appear by the time the time ends so you’ll be fine

No, I had to set the TextChatService to Legacy

Well yes that works to, but at the same time this can also solve the problem.
In coding many things can solve one problem! Just cause one thing works doesnt mean others wont! So keep an open mind!

Anyhow thats all I have to say

It wouldn’t have appeared if I didn’t do that, if I just tried your solution it wouldn’t have worked.

1 Like