Finding the Chat window

When a player joins my game, I like to send a few system to display in the chat window.
I have the server detect the player joined, then send the text via a remote event, then on the client, it gets that event and calls TextChatService to display the message.

The problem is , unless I put a ‘wait’ before showing the chat, it doesn’t show up. Meaning the chat system must not be ready for the instruction to display text in the chat window.

I was wanting to find a way to know when the chat system is ready. I thought if I could look in CoreGui, and see if I detect the chat window, maybe that would be an easy way to do this.

But I don’t know how to check for the chat gui in this way.

Any help is appreciated.

You could try:

repeat task.wait(2) until game:IsLoaded() 
task.wait(1) -- just for extra safety

(On the client side)

If you want to yield on the server side, use a remote and write

Remote.OnServerEvent:Wait() 

And fire it from the client after the block of code above