Help with System Messages

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.

How do I get the system message to send?

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.

1 Like

Yeah, I experimented with waits a bit and it seems consistent enough. Though I am concerned about how it would affect lower-end devices.

Nonetheless, whether the message fails to send or not is a trivial feature and is probably not worth the time pursuing perfection on.

Thanks for your insight.

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