im trying to make gradients with chat tags, how do I do this?
local TextChatService = game:GetService("TextChatService")
local MarketPlaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local chatWindowConfiguration = TextChatService.ChatWindowConfiguration
TextChatService.OnChatWindowAdded = function(message: TextChatMessage)
local properties = chatWindowConfiguration:DeriveNewMessageProperties()
if message.TextSource then
local player = Players:GetPlayerByUserId(message.TextSource.UserId)
if player.Name == "ikDebris" then
properties.PrefixText = "[Owner] " .. message.PrefixText
properties.PrefixTextProperties = chatWindowConfiguration:DeriveNewMessageProperties()
local gradient = Instance.new("UIGradient")
gradient.Color = ColorSequence.new(Color3.fromRGB(170, 170, 255), Color3.fromRGB(255, 255, 255))
properties.PrefixTextProperties.TextLabel.TextGradient = gradient
elseif MarketPlaceService:UserOwnsGamePassAsync(player.UserId, 1043958772) then
properties.PrefixText = "[VIP] " .. message.PrefixText
properties.PrefixTextProperties = chatWindowConfiguration:DeriveNewMessageProperties()
local gradient = Instance.new("UIGradient")
gradient.Color = ColorSequence.new(Color3.fromRGB(85, 170, 127), Color3.fromRGB(255, 255, 255))
properties.PrefixTextProperties.TextLabel.TextGradient = gradient
end
end
return properties
end