
Pretty much anything is possible with the lua chat system, some things are just much harder to achieve, or at least require good knowledge of how the lua chat system is structured
What I’ve done, is, in this module

I’ve modified the :AddNameButtonToBaseMessage()
function to add a gradient to the player’s name
function methods:AddNameButtonToBaseMessage(BaseMessage, nameColor, formatName, playerName)
local speakerNameSize = self:GetStringTextBounds(formatName, BaseMessage.FontFace, BaseMessage.TextSize)
local NameButton = self:GetFromObjectPool("TextButton")
NameButton.Selectable = false
NameButton.Size = UDim2.new(0, speakerNameSize.X, 0, speakerNameSize.Y)
NameButton.Position = UDim2.new(0, 0, 0, 0)
NameButton.BackgroundTransparency = 1
NameButton.FontFace = BaseMessage.FontFace
NameButton.TextSize = BaseMessage.TextSize
NameButton.TextXAlignment = BaseMessage.TextXAlignment
NameButton.TextYAlignment = BaseMessage.TextYAlignment
NameButton.TextTransparency = BaseMessage.TextTransparency
NameButton.TextStrokeTransparency = BaseMessage.TextStrokeTransparency
NameButton.TextColor3 = nameColor
NameButton.Text = formatName
NameButton.Visible = true
local IsActive = true -- Variable I added to handle when the Text is deleted
do -- Player gradient
-- Function that returns a triangle waveform from a time t
-- There are 1 triangle per second, with slopes 2 and -2
-- If you have a cyclic color sequence, you might not need a triangle waveform, but rather just a floored (x % 1) function
local function TriangleFunction(t)
return t % 1 < 1/2 and (t % (1/2))*2 or 1 - (t % (1/2))*2
end
local UIGradient = Instance.new("UIGradient")
UIGradient.Color = ColorSequence.new({
ColorSequenceKeypoint.new(0, Color3.fromRGB(183, 1, 255)),
ColorSequenceKeypoint.new(1, Color3.fromRGB(255, 11, 117))
})
UIGradient.Parent = NameButton
NameButton.TextColor3 = Color3.new(1,1,1) -- Set the player's color to white so the gradient isn't affected by it
task.defer(function()
while IsActive do
UIGradient.Offset = Vector2.one*(TriangleFunction(os.clock()/3)*2 - 1) -- Oscillates between -1 and 1
task.wait()
end
end)
end
NameButton.Parent = BaseMessage
local clickedConn = NameButton.MouseButton1Click:connect(function()
self:NameButtonClicked(NameButton, playerName)
end)
local changedConn = nil
changedConn = NameButton.Changed:connect(function(prop)
if prop == "Parent" then
IsActive = false
clickedConn:Disconnect()
changedConn:Disconnect()
end
end)
return NameButton
end
I also made the gradient move over time, for a cool effect
Something that would be useful would be to have the messageData.ExtraData
available to those functions (something I might add to this port), as that would allow for much more in depth customizability that can be specified when creating/sending the messages (messageData.ExtraData
can be accessed by callback functions when a message is sent, making it ideal for adding tags or changing various things about a message)
This is something I really like with the lua chat system, everything is possible if you’re able to make it. The way it was built allowed for these features without forking the whole thing (which is good and bad, as the roblox team were limited in the changes they could do). From the customization system alone the lua chat system is very feature rich, but if you allow yourself to fork it, then the possibilities are endless
Of course, the downside is that these aren’t accessible to less advanced scripters, without a youtube tutorial or something, unlike TextChatService’s default ui which is more limited but much more beginner friendly