Multi-Colored System Make Chat Message

Hi! I recently came across an amazing system that is able to send a chat message with different colored text. How would that work? As far as I know, you can only use one color.
I’m sure they messed with the chatModules, but where does the ChatModules hold the functions such as ChatMakeSystemMessage?

The system:

What i’ve got:

game.ReplicatedStorage.SendAnnouncement.OnClientEvent:Connect(function(txt)
	print("posting announcement")
	wait(1)
	game.StarterGui:SetCore("ChatMakeSystemMessage", {
		Text = txt;
		Font = Enum.Font.Cartoon;
		Color = Color3.fromRGB(245,50,120);
		FontSize = Enum.FontSize.Size96;	
	})
end)

I just can’t find a way because there’s only one color section, is there a formatting or such? ( Such as, | colored text | uncolored text? )

1 Like

This is setting the Core in the Player’s Gui, thats why you are firing all the clients, and you are receiving a client event.
Thread on SetCore

I know it’s SetCore, but I am wondering how there’s multiple colors for ChatMakeSystemMessage. Is there any formatting documents of any sort?

1 Like

Do you mean like have half of it a certain color, like [System] and the message? If thats what you mean, I think you can only make it one Color if you are using this method.

Yeah that’s what I mean. I thought there was only one method to send a message to chat though? Is there any documentation for other methods?

1 Like

I don’t think there is any other methods, my bad. So as I said, I am pretty sure you can’t set it more than one color.

Well, there must be a way considering in the image given, there is multiple colors. :confused:

1 Like

I found this solution on the web, and it does indicate as I said you cannot use multiple colors on SetCore, but you can make a custom script. Here is the post;

2 Likes

Just note that the above doesn’t explain how to change colours, only how to add a bot speaker to the chat. You should be able to do this without forking anything or even using the Lua Chat System folders. Even if you do, just insert a BoolValue named InsertDefaultValues and check it off so that the other modules load; no need to fork them too.

Everything you’re looking for is available in the Lua Chat System documentation, specifically ChatSpeaker. You’ll have to go a little ways to do this. Simply; create a new speaker and add their data.

Creating a module in ChatModules or using an external script has relatively the same solution. The difference is that ChatModules have ChatService passed to them, while an external script needs to wait for the ChatService.

Structures for your code:

-- ChatModule
local function Run(ChatService)
    -- Code
end

-- External script
local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner").ChatService)

Once you have the ChatService in either method, the rest becomes straight forward. Add a speaker and give them different colours as you want. What you’re seeing here is a name and chat colour.

local speaker = ChatService:AddSpeaker("Announce")

speaker:JoinChannel("All") -- Does NOT join all channels! Only the global one.
speaker:SetExtraData("NameColor", BrickColor.new("Lime green").Color)
speaker:SetExtradata("ChatColor", BrickColor.new("Persimmon").Color)

speaker:SayMessage(".announce <global> <popup> <anon> <message>", "All")

That’s all there is to it.

15 Likes