Trying to add VIP chat tag to players chat message. I’ve got this working (with gradient), however, it resets the players’ username colour (the one Roblox provides). Here is my code.
local ChatWindowConfiguration = TextChatService.ChatWindowConfiguration
TextChatService.OnChatWindowAdded = function(Message: TextChatMessage)
local Props = ChatWindowConfiguration:DeriveNewMessageProperties()
if Message.TextSource then
local Sender: Player = Players:GetPlayerByUserId(Message.TextSource.UserId)
if Sender:GetAttribute("IsVIP") then
Props.PrefixText = `[VIP]`
Props.Text = `{Message.PrefixText} {Message.Text}`
Props.PrefixTextProperties = ChatWindowConfiguration:DeriveNewMessageProperties()
Assets.VIPTagGradient:Clone().Parent = Props.PrefixTextProperties
end
end
return Props
end
Note: OnMessageIncomming doesn’t support gradients, hence the weird connection name choice they chose called “OnChatWindowAdded”.
Preview of code:
The closest thing that can be done is giving the username a custom colour, but I want the player to see the one Roblox provides.
All help is appreciated!