How to make specific words in chat different color?

So for example:

Player has died!

Player has = orange
died = red
! = orange

I wasn’t able to find anything on this topic! I know it must be some code like:

</></><

For the new chat, not legacy chat!

Do you mean rich text?
<b>e</b> or <font color=‘rgb(255, 255, 255)’>Hola</font>

3 Likes

For some reason that “<font color=‘rgb(255, 255, 255)’>Hola” prints the command in chat when I connect it with Channel:DisplaySystemMessage(“<font color=‘rgb(255, 255, 255)’>Hola”)

I wasn’t thinking and I found a solution to my problem!

local TextChatService = game:GetService("TextChatService")
local Channel = TextChatService:WaitForChild("TextChannels"):WaitForChild("RBXSystem")

-- Generate System Message
local function GenerateSystemMessage(MsgDict: array)
	return '<font color="#'..MsgDict["Color"]..'"><font size="'..MsgDict["FontSize"]..'"><font face="'..MsgDict["Font"]..'">'..MsgDict["Text"]..'</font></font></font>'
end

-- Get Message and Create Chat Message
local function GetMessage()
	Channel:DisplaySystemMessage(GenerateSystemMessage({
		Text = "Swag",
		Font = "SourceSansBold",
		Color = Color3.fromRGB(85, 0, 0):ToHex(),
		FontSize = "17",
	})..GenerateSystemMessage({
		Text = " Test",
		Font = "SourceSansBold",
		Color = Color3.new(1,0,0):ToHex(),
		FontSize = "17",
	}))
end

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