How to send a message to the chat?

I’m using:

game.StarterGui:SetCore("ChatMakeSystemMessage", x)

This works for LegacyChatService mode. But not the new one.

What’s the updated way?

Put this in a local script. If you want to fire a chat message from the server, use a remote event.

local TextChatService = game:GetService("TextChatService")
YourRemoteEvent.OnClientEvent:Connect(function()
     TextChatService.TextChannels.RBXGeneral:DisplaySystemMessage("foobar")
end)

If you want the chat to have color, you can do this

TextChatService.TextChannels.RBXGeneral:DisplaySystemMessage(`<font color='#fbff0a'>{themessageyouwanttosend}</font>`)   --Make sure you use a hex color
3 Likes

It works, but the actual html string is posted.
image

Is there a way to use color?

EDIT: I see my color3 encoded problem, but that still wouldn’t render as html code

Can you send me the exact line you used? Make sure that there aren’t any quotes around your message in the middle.

1 Like

Oh it was my color3 encoded problem - sorry about that I thought it would have just failed to give a color.

Fixed, thanks for your help!

1 Like

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