Purchased Chat Tags

I’ve got some chat tags setup on my server, but I currently have to manually add them or edit them in a server file. So instead I copied a chunk of code from the text hat and made an item they can buy in the show to set up their tag with their colour. Now I’ve been trying to get the lua file to check if they have a item tag set up, but I can’t seem to figure it out. If someone could point me in the right direction that would be very helpful.


These tags are added by rank, but if a player is VIP they can request a custom tag that will overwrite their ranking tag.

[lua]ITEM.Name = ‘Chat Title’
ITEM.Price = 3000
ITEM.Model = ‘models/extras/info_speech.mdl’
ITEM.NoPreview = true
ITEM.VIP = true

local MaxTextLength = 16

function ITEM:Modify(modifications)
Derma_StringRequest(“Chat Title”, “What text do you want your title to say?”, “”, function(text)
modifications.text = string.sub(text, 1, MaxTextLength)
PS:ShowColorChooser(self, modifications)


Then the next window is the colour shooser.

I first check for the item being equipped, but how would I get the values for the colour and text?

[lua] if a:IsValid() then
if a:PS_HasItemEquipped(‘chat_tag’) then
table.insert( C, cWhite )
table.insert( C, “[” )

		table.insert( C, cWhite ) // Modification colour
		table.insert( C, 'PlaceHolder') // Modification text
		table.insert( C, cWhite )
		table.insert( C, "]" )[/lua]

How would I get the modifications text and colours?