This is because the API function directly only accepts tag text and tag colors, not images. To add tags with images you’ll need to add it to the speaker.tags
table, like so:
return function(api)
local sss = game:GetService("ServerScriptService")
local internalName = "RoleTag"
sss.ChangeTag.Event:Connect(function(player, role_icon)
local speaker = api.speaker:getById(player.UserId)
for idx,tag in pairs(speaker.tags) do
if(tag.name == internalName) then
table.remove(speaker.tags,idx)
end
end
table.insert(speaker.tags,{
text = "",
image = role_icon,
color = Color3.fromRGB(0,0,0), --> does not support colors directly
name = internalName --> Not normally a property, this is custom for this script
})
end)
end
If you want the other desired behavior, you’d need to rewrite the function, which I will not be personally adding to the system as my own because it will break other people who are using the API for that purpose.
And it does not take custom colors, so to do that you’d need to go to
src > client > modules > core > messages > default
and add at line 270 or so add:
image.ImageColor3 = tag.color or Color3.fromRGB(255,255,255)
This will make it accept a .color
property for the tags. I will be oficially adding this in the next update as well as an image tags overhaul to use the same system as custom emojis for better appearances.
To add tags without images, it would be like so:
speaker:addTag("text",Color3.fromRGB(255,0,0))
This is intended behavior, you can disable it in the configuration in Messages.MessageGrouping.Enabled
,
it’s meant to make messages sent by the same user back-to-back appear to merge together.