Help! How do I change a player's name's chat color?

Hi! I’ve been searching the dev forums for a way to overwrite the color of a player’s name in the normal Roblox chat of my experience, how can I achieve that?

Thank you! Have a great day :slight_smile:

You can use the TextChatService in a LocalScript.

local tcs = game:GetService("TextChatService")
local players = game:GetService("Players")

tsc.OnIncomingMessage = function(message:TextChatMessage)
    if not message.TextSource then return end
    local player = players:GetPlayerByUserId(message.TextSource.UserId)
    if not player then return end
    local properties = Instance.new("TextChatMessageProperties")
    properties.PrefixText = tostring("<font color = \"rgb(0, 0, 0)\">["..player.Name.."]: </font>")
    return properties
end

Just change the “rgb()” values. Alternatively, you could use a hex code:

properties.PrefixText = tostring("<font color = \"#FF8500\">["..player.Name.."]: </font>") --orange chat colour
```q
5 Likes

@12345koip Thank you for the help! Have a nice evening :slight_smile:

2 Likes

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