Quick table question

I have a quick question, if I have this table:

Settings = Settings or {}

Settings.GroupTags = {
	["superadmin"] 		= { groupColor = Color(255, 76, 76, 100), groupRank = "OWNER", isStaff = true },

How do I use table.HasValue to see if “superadmin” exists within Settings.GroupTags
It appears no matter how I try to flip my code around, it skips that if condition and goes to else as if it cannot see “superadmin” in the table.

if table.HasValue( Settings.GroupTags, ply:GetUserGroup() ) then
	draw.SimpleText( Settings.GroupTags[ply:GetUserGroup()].groupRank, "RankName", 72, h / 1.4, Settings.GroupTags[ply:GetUserGroup()].groupColor, 0, 1 )
	draw.SimpleText( "PLAYER", "RankName", 72, h / 1.4, Color(0,255,0,255), 0, 1)

And yes I have ply defined to LocalPlayer() just wanted to keep the code simple because I know it’s somewhere just in this area.

Thanks in advance

HasValue loops through the table and check for the Values not the Keys
if( Settings.GroupTags[ ply:GetUserGroup() ], this returns nil if the key doesn’t exist

local test = { "superadmin", "admin" };
print( table.HasValue( test, "superadmin" ) ) ; // true
print( test[ 1 ] ); // superadmin
print( test[ "superadmin" ] ); // nil

I see, so what would be the most affective way to set this up so I can check to see if the person’s usergroup exists within the table, and then if it does continue to the next line, so I can call the color, etc.

if( Settings.GroupTags[ ply:GetUserGroup() ] ) then
local color = Settings.GroupTags[ ply:GetUserGroup() ][ "groupColor" ];

see: a table is
table[ key ] = value
if you make a table as
table = { “here is value 1”, 123, 345 };
then table[ 2 ] = 123,
if you do:
table = {};
table[ 123 ] = 345;
then the Key is 123 and holds the Value 345

table[ 1 ][ “groupColor” ] = Color( 255, 255, 255, 255 );
here it’s assumed that the value that key 1 holds is another table, which (possibly amongst other things) has a key called groupColor which holds a Color

or wait, re-reading that again (sorry) I should completely drop table.hasvalue all together and use something as to what you posted, a conditional statement just looking for the usergroup within the table.

[editline]16th May 2015[/editline]

Thanks. I’ll try. Hopefully this does the trick. Was assuming hasvalue was the right way to go.

[editline]16th May 2015[/editline]

Thanks Busan1. That helps a lot. Appreciate your time and helping with this.