HUD Development Issues


I have made my HUD to show the current ULX Group that the player is in, but i would also like to be able to change 1. The color of the rank when it shows and 2. The wording/Capitilization

This is ONLY the rank code.

local Rank = (ply.GetUserGroup and ply:GetUserGroup()) --ULX
	newx, newy = draw.SimpleText( "Rank: "..Rank, "FONT", spacer + 125, 7, Color(100,100,255), 0 )
	E_Rect( (spacer + newx) - 17, 6, 20, 20, iconcolor, shield )
	spacer = (spacer + newx) + 50

Here is what im looking for:

//For the Usergroup colors im looking for how to do this
UsergroupColors = {
	superadmin = "rainbow",
	admin	= Color(255, 55, 55)

//The user group styling something the same

UsergroupsStyle = {
	superadmin = "Owner",
	admin = "Admin"

All help is greatly appreciated, this is what it looks like right now

For capitalizing the first character a table would be faster but if you don’t want a table you can do “string.upper(string.sub(rank, 1, 1)) … string.sub(rank, 2)”.

function string.TylerWearing(self)
    return (self:gsub("[^ ]+", function(word)
        return word:sub(1, 1):upper() .. word:sub(2)
print(string.TylerWearing("nyello there friendo")) -- Output: Nyello There Friendo

He said he did want a table.

You would just do UsergroupsStyle[ply:GetUserGroup()] etc.