--Config here-- --All colors can be RGB color codes or the string "Rainbow"-- --All tags will be surrounded by white square brackets []-- local Tags = { --ULX Group | Tag | Rank Color | Text Color or it will be white | Name Color or it will be team default-- {"mod", "M", Color(126, 255, 66) }, {"superadmin", "SA", Color(255, 55, 55) }, {"trusted", "T", Color(105, 105, 255) }, {"vip", "VIP", "Rainbow" } } --Console name color local ConsoleColor = Color(0, 255, 0) --Config end-- local tab = {} function RainbowString( str ) local inc = nil if alp == nil then local alp = 255 end local len = string.len( str ) if len == 0 or len == 1 then return Color( 255, 0, 0 ),str end local let = string.Explode( "", str ) if len >= 360 then inc = 1 else inc = 360/ len end local rst = nil local con = 0 for i=1, #let do con = con + 1 local v = let[ i ] if rst == nil then rst = {HSVToColor( con * inc, 1, 1 ),v} else local rtt = unpack(rst) rst[#rst+1] = HSVToColor( con * inc , 1, 1 ) rst[#rst+1] = v end end for k,v in pairs(rst) do table.insert( tab, v ) end end hook.Add( "OnPlayerChat", "Tags", function(ply, strText, bTeamOnly, bPlayerIsDead ) if IsValid(ply) and ply:IsPlayer() then for k,v in pairs(Tags) do if ply:IsUserGroup( v[1] ) then if v[3] == "Rainbow" then table.insert( tab, Color( 255, 255, 255, 255 ) ) table.insert( tab, "[" ) RainbowString( v[2] ) table.insert( tab, Color( 255, 255, 255, 255 ) ) table.insert( tab, "] " ) else table.insert( tab, Color( 255, 255, 255, 255 ) ) table.insert( tab, "[" ) table.insert( tab, v[3] ) table.insert( tab, v[2] ) table.insert( tab, Color( 255, 255, 255, 255 ) ) table.insert( tab, "] " ) end if bPlayerIsDead then table.insert( tab, Color( 255, 0, 0, 255 ) ) table.insert( tab, "*DEAD* " ) end if bTeamOnly then table.insert( tab, Color( 0, 255, 0, 255 ) ) table.insert( tab, "(TEAM) " ) end if v[5] != nil then if v[5] == "Rainbow" then RainbowString( ply:Nick() ) else table.insert( tab, v[5] ) table.insert( tab, ply:Nick() ) end else table.insert( tab, team.GetColor( ply:Team() ) ) table.insert( tab, ply:Nick() ) end table.insert( tab, Color( 255, 255, 255, 255 ) ) table.insert( tab, ": " ) if v[4] != nil then if v[4] == "Rainbow" then RainbowString( strText ) else table.insert( tab, v[4] ) table.insert( tab, strText ) end chat.AddText( unpack(tab) ) return true else table.insert( tab, strText ) chat.AddText( unpack(tab) ) return true end end end end if !IsValid(ply) and !ply:IsPlayer() then chat.AddText(ConsoleColor, "Console", color_white, ": ", strText) return true end end )