Adding more icons for different groups?

i want to add other groups to the silkchat for like vip and moderators to have there own icon to tell them apart? i tired before but i messed up can i get help? here is some of the code if want more tell me

[LUA]local function getPlayerIcon(ply)

local icon = "icon16/user.png"

if LevelIcon and ASS_VERSION then // hey assmod!
		
	icon = LevelIcon[ply:GetNWInt("ASS_isAdmin", 5)]
	
else
	
	if ply:IsSuperAdmin() then
		
		icon = "icon16/shield_add.png"
		
	elseif ply:IsAdmin() then
		
		icon = "icon16/shield.png"
		
	end
	
end

return icon

end[/LUA]

add another elseif with "ply:IsUserGroup(“groupname”) like this
[lua]
–Some lua code
else

    if ply:IsSuperAdmin() then
         
        icon = "icon16/shield_add.png"
         
    elseif ply:IsAdmin() then
         
        icon = "icon16/shield.png"
         
    elseif ply:IsUserGroup("groupsname") then
        
        icon = "icon/path.png"

    end

end
–rest of the code[/lua]

Althought I don’t know if you are setting any usergroups or if assmod is setting them, but it should work if it does.

i tired that and it didnt work…?? im using ulx if that helps

Maybe you didn’t input the group correctly.
Show us the modified code.

[lua] else

    if ply:IsSuperAdmin() then
          
        icon = "icon16/shield_add.png"
          
    elseif ply:IsAdmin() then
          
        icon = "icon16/shield.png"
          
    elseif ply:IsUserGroup("owner") then
         
        icon = "icon16/shield_rainbow.png"
   
   elseif ply:IsUserGroup("moderator") then
         
        icon = "icon16/shield_silver.png"
		
    elseif ply:IsUserGroup("vip") then
         
        icon = "icon16/rosette_blue.png"
   
   end

end[/lua]