I’m trying to get a client system message to send when the player joins:
local TextChatService = game:GetService("TextChatService")
local textChannels: Folder = TextChatService:WaitForChild("TextChannels")
local generalChannel: TextChannel = textChannels:WaitForChild("RBXGeneral")
generalChannel:DisplaySystemMessage("Welcome")
However, it seems that this code runs before the Roblox chat UI and scripts (in CoreGui) has loaded, therefore not showing the message.
The obvious solution is to add some sort of wait() before sending the message, which works, but I don’t want to settle on something potentially unreliable.
FWIW, I played with this a little but couldn’t find anything better than a wait(1). The OnIncomingMessage signal fires whether the message is actually displayed or not. The same goes for text commands. CoreGui is no longer accessible so there’s no way to inspect the UI frame to see if children have been added.