So I have a personal chat tag and I also have a VIP one but I want to have both at the same time but cannot figure out how to add them both at the same time
looking for something like this
I’ve made the code for both of them, I just don’t know how to put them next to eachother
local textChatService = game:GetService("TextChatService")
local marketplaceService = game:GetService("MarketplaceService")
textChatService.OnIncomingMessage = function(message: TextChatMessage)
local properties = Instance.new("TextChatMessageProperties")
if message.TextSource then
local player = game:GetService("Players"):GetPlayerByUserId(message.TextSource.UserId)
if player.Name == "cozfl" then
properties.PrefixText = "<font color='#fcd303'>[boing] </font>".. message.PrefixText
end
if player.Name == "930mossburg" then
properties.PrefixText = "<font color='#fcd303'>[cozfl's Alt] </font>".. message.PrefixText
end
if marketplaceService:UserOwnsGamePassAsync(player.UserId, 205290393) then
properties.PrefixText = "<font color='#fcd303'>[VIP] </font> "..message.PrefixText
end
end
return properties
end
This is what it looks like right now
The vip is a gamepass so anyone who owns it gets it
local textChatService = game:GetService("TextChatService")
local marketplaceService = game:GetService("MarketplaceService")
textChatService.OnIncomingMessage = function(message: TextChatMessage)
local properties = Instance.new("TextChatMessageProperties")
if message.TextSource then
local prefixes = ""
local player = game:GetService("Players"):GetPlayerByUserId(message.TextSource.UserId)
if player.Name == "cozfl" then
prefixes ..= "<font color='#fcd303'>[boing] </font>"
end
if player.Name == "930mossburg" then
prefixes ..= "<font color='#fcd303'>[cozfl's Alt] </font>"
end
if marketplaceService:UserOwnsGamePassAsync(player.UserId, 205290393) then
prefixes ..= "<font color='#fcd303'>[VIP] </font> "
end
properties.PrefixText = prefixes .. message.PrefixText -- After, add the name (?) or whatever this is
end
return properties
end
If you want to add another Tag, but have it a different color, or Font, you have to wrap it in a seperate HTML, so for example:
"<font color='rgb(255,255,255)'>[Example1]</font> <font color='rgb(0,0,0)'>[Example2]</font>"
-- these are two separate Tags that have two separate Colors
So In order to add more than one tag, you would need to concatenate the string to add the extra data, which basically means combining two strings together.