Local script not sending chat message, despite having no errors

I am trying to send the message hello through script and I got no errors. Everything is printing right, such as “message sent” but why is the chat message still not there?

Server script:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("AdminUpdateRE")

function sendAnnouncement(message)
    remoteEvent:FireAllClients(message)
end

sendAnnouncement("Hello")

Local Script:

local remoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("AdminUpdateRE")
local StarterGui = game.StarterGui

remoteEvent.OnClientEvent:Connect(function(message)
    StarterGui:SetCore("ChatMakeSystemMessage", {
        Text = message,
        Color = Color3.new(1, 1, 1),
        Font = Enum.Font.SourceSansBold,
        TextSize = 18
    })
    print("message sent")
end)
2 Likes

Okay, this is really weird.

The code didn’t work just like you said when I brought it into a new baseplate game. And I also noticed that there is a new chat GUI?!
image

But when I brought it into my game that I’ve been working on, it worked and my chat is normal.
image

Another thing I noticed is that there is no Chat GUI when testing the game.
image

However, in my game there is!
image

I did actually modify my chat a bit but I believe I only change the font.
Maybe this could be a new chat update that I’ve missed. I’ll do some more research on this.

So turns out I’m dumb. There was a new chat window customization update last year that I missed because the chats in most games were kept the same.

I think the chat is only affected in newer games created after the chat update. Which is why it didn’t affect my game. But I’m still not sure why game.StarterGui:SetCore("ChatMakeSystemMessage", message) doesn’t work. I’ve done some research and I still can’t find anything…

EDIT: I found a way. You just change the “ChatVersion” property to “LegacyChatService”.
image

image

The only issue with this is that I’m not sure how to do it if you want the newer chat version.

2 Likes

TextChatService works very differently to LegacyChatService so many things that were done in the old chat have to be done another way now. Because of this, games already using the old chat keep using the old chat while newly made games use TextChatService by default.

ChatMakeSystemMessage doesn’t work on TextChatService probably because it just doesn’t support it at all, at least for now. To print system messages in TextChatService, you need to use :DisplaySystemMessage() in one of the text channel objects inside TextChatService.

Example:

-- In a local script.
local TextChatService = game:GetService("TextChatService")

-- RBXSystem and RBXGeneral are the default text channels.
TextChatService:WaitForChild("TextChannels"):WaitForChild("RBXSystem"):DisplaySystemMessage("Test message")

Also, customizing the system message now requires using rich text, instead of passing other arguments. If the rich text is confusing though, I did make a module script (pardon the self-advertising) that simplifies creating and customizing system messages in TextChatService along with other stuff.

You can learn more about how TextChatService works here.

3 Likes

Thank you for clarifying this. I didn’t know they added a new chat system last year. This is really good info.

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