Hey!
I am trying to add chat tags to my game and I know how to add one. But how could I add more than 1?
Here is my script I am trying to run:
local function generateChatTag(text: string, colour: Color3): string
return '<font color="'..colour..'"><font size="17"><font face = "GothamBold">'..text..'</font></font></font>'
end
local Players = game:GetService("Players")
local TextChatService = game:GetService("TextChatService")
local MarletplaceService = game:GetService("MarketplaceService")
TextChatService.OnIncomingMessage = function(message: TextChatMessage)
local Properties = Instance.new("TextChatMessageProperties")
Properties.Text = "<font size='17'><font face ='GothamBold'>"..message.Text.."</font></font>"
if message.TextSource then
local Player = Players:GetPlayerByUserId(message.TextSource.UserId)
-- VIP
if MarletplaceService:UserOwnsGamePassAsync(Player.UserId, 29234373) then
Properties.PrefixText = generateChatTag("[".."VIP".."] [" ..message.PrefixText.."]", "#FAD126") --change the hex code to whatever you want you can look up one btw
end
-- Creator tag
if Player.UserId == "1056152894" then
Properties.PrefixText = generateChatTag("[".."Creator".."] [" ..message.PrefixText.."]", "#B30000")
end
end
return Properties
end
It only shows the VIP tag and not the Creator and VIP tag at the same time. Let me know how I can fix this problem.
Thanks!
Sincerely,