How to make multiple color in ChatMakeSystemMessage

i want the “PetName” have different color , what do i do

local StarterGui = game:GetService("StarterGui")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Player = game.Players.LocalPlayer

local RarityColor = {
	["Common"] = Color3.fromRGB(95, 255, 21),
	["Uncommon"] = Color3.fromRGB(25, 255, 248),
	["Rare"] = Color3.fromRGB(255, 144, 33),
	["Legendary"] = Color3.fromRGB(255, 0, 4)
}


ReplicatedStorage.UnboxedServerMSG.OnClientEvent:Connect(function(PetRarity, PetName)
	
	StarterGui:SetCore("ChatMakeSystemMessage",{
		Text = 	"[System] "..Player.Name.." unboxed a"..PetName,
	})
end)

Maybe use a gradient? I can’t think of anything else. Not even sure that would work.

no i just want the “PetName” have different color

AFAIK you can’t accomplish this with Roblox’s chat GUI at the moment since you aren’t able to edit the TextLabel variables to enable RichText.

You can create your own chat system that has RichText enabled in order to create this though - here’s a link with more information:

You’d have to check the PetRarity from the table, and change the Colour of ChatMakeSystemMessage by inputting Color = PetRarity from Color3, just like you did with the text.

To have more clarification of what you can do with that event, see :SetCore().

As @Imp_erator stated, as of current, it’s not possible to seperate the colours in a sentence using SetCore, but you can try using RichText with TextLabels instead.