Seperating gradient from tag

Hello, I would like to know how I can seperate the gradient to not appear on the “(C)” tag but remain on the actual tag and player name unlike it is here:
image

-- the only important part of the code is shown
local Team = ""
Team = "<font color='#"..player.Team.TeamColor.Color:ToHex().."'>".."("..tostring(player.Team):sub(1,1)..")".."</font> "
local Tag = "<font color='#"..Color:ToHex().."'>".."["..Text.."]".."</font> "
local PlayerName = "<font color = \"rgb("..r..", "..g..", "..b..")\">"..player.Name..":</font>"

props.PrefixText = Team..Tag..PlayerName
props.PrefixTextProperties = chatWindowConfiguration:DeriveNewMessageProperties()
gradient:Clone().Parent = props.PrefixTextProperties
hi
--LocalScript in StarterPlayerScripts
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local PlayerGui = player:WaitForChild("PlayerGui")

local ChatGui = Instance.new("ScreenGui", PlayerGui)
ChatGui.Name = "CustomChatGui"

local ChatFrame = Instance.new("ScrollingFrame", ChatGui)
ChatFrame.Size = UDim2.new(0,400,0,200)
ChatFrame.Position = UDim2.new(0,50,0,50)
ChatFrame.CanvasSize = UDim2.new(0,0,0,0)
ChatFrame.ScrollBarThickness = 6
ChatFrame.BackgroundTransparency = 0
ChatFrame.BackgroundColor3 = Color3.fromHex("7D8494")
ChatFrame.AutomaticCanvasSize = Enum.AutomaticSize.Y

local UIListLayout = Instance.new("UIListLayout", ChatFrame)
UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
UIListLayout.Padding = UDim.new(0,2)

local function rainbowText(text)
	local colors = {
		Color3.fromRGB(255,0,0),
		Color3.fromRGB(255,127,0),
		Color3.fromRGB(255,255,0),
		Color3.fromRGB(0,255,0),
		Color3.fromRGB(0,0,255),
		Color3.fromRGB(75,0,130),
		Color3.fromRGB(148,0,211),
	}
	local result = ""
	for i = 1, #text do
		local c = text:sub(i,i)
		local color = colors[(i-1)%#colors+1]
		result ..= "<font color='#"..color:ToHex().."'>"..c.."</font>"
	end
	return result
end

local function addMessage(message)
	local msgLabel = Instance.new("TextLabel", ChatFrame)
	msgLabel.Size = UDim2.new(1,0,0,20)
	msgLabel.BackgroundTransparency = 1
	msgLabel.RichText = true
	msgLabel.TextXAlignment = Enum.TextXAlignment.Left
	msgLabel.TextYAlignment = Enum.TextYAlignment.Top
	msgLabel.TextWrapped = true

	msgLabel.Text = "\n".. "  ".. rainbowText(player.Name..":").." <font color='#FFFFFF'>"..message.."</font>"
end

local function onSend()
	local message = "hi"
	addMessage(message)
end

onSend()
chat input
--LocalScript in StarterPlayerScripts
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local PlayerGui = player:WaitForChild("PlayerGui")

local ChatGui = Instance.new("ScreenGui", PlayerGui)
ChatGui.Name = "CustomChatGui"

local ChatFrame = Instance.new("ScrollingFrame", ChatGui)
ChatFrame.Size = UDim2.new(0,400,0,200)
ChatFrame.Position = UDim2.new(0,50,0,50)
ChatFrame.CanvasSize = UDim2.new(0,0,0,0)
ChatFrame.ScrollBarThickness = 6
ChatFrame.BackgroundTransparency = 0
ChatFrame.BackgroundColor3 = Color3.fromHex("7D8494")
ChatFrame.AutomaticCanvasSize = Enum.AutomaticSize.Y

local UIListLayout = Instance.new("UIListLayout", ChatFrame)
UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
UIListLayout.Padding = UDim.new(0,2)

local function rainbowText(text)
	local colors = {
		Color3.fromRGB(255,0,0),
		Color3.fromRGB(255,127,0),
		Color3.fromRGB(255,255,0),
		Color3.fromRGB(0,255,0),
		Color3.fromRGB(0,0,255),
		Color3.fromRGB(75,0,130),
		Color3.fromRGB(148,0,211),
	}
	local result = ""
	for i = 1, #text do
		local c = text:sub(i,i)
		local color = colors[(i-1)%#colors+1]
		result ..= "<font color='#"..color:ToHex().."'>"..c.."</font>"
	end
	return result
end

local function addMessage(name, message)
	local msgLabel = Instance.new("TextLabel", ChatFrame)
	msgLabel.Size = UDim2.new(1,0,0,20)
	msgLabel.BackgroundTransparency = 1
	msgLabel.RichText = true
	msgLabel.TextXAlignment = Enum.TextXAlignment.Left
	msgLabel.TextYAlignment = Enum.TextYAlignment.Top
	msgLabel.TextWrapped = true

	msgLabel.Text = "\n".."  "..rainbowText(name..":").." <font color='#FFFFFF'>"..message.."</font>"
end

Players.PlayerAdded:Connect(function(plr)
	if plr ~= player then
		plr.Chatted:Connect(function(msg)
			addMessage(plr.Name, msg)
		end)
	end
end)

for _, plr in pairs(Players:GetPlayers()) do
	if plr ~= player then
		plr.Chatted:Connect(function(msg)
			addMessage(plr.Name, msg)
		end)
	end
end

player.Chatted:Connect(function(msg)
	addMessage(player.Name, msg)
end)

I tried to do what I saw in this post. You didn’t say it needed to be in the real chat box, and after trying, I’m not sure that is even possible.. other than rebuilding it. At some point, I didn’t see the use in the team thing, as it is a rainbow thing anyway. I’ve always liked to try and mimic things I see done. This was definitely a challenge. Maybe if I could have seen the non-important parts, it would have made more sense what you’re trying to do here. Hope this helps in some way.. It was interesting to work on.

blaa, I did a double post on that chat input version.. “hi” is there now.

gradient applies to the whole textlabel, you’d have to map each character and do the gradient yourself

or remove textrich and purely rely on gradient (make hard changes on gradient)