Class CustomCheck (and something else)

So, on my DarkRP server, I want to add the ULX Ranks vip, vipoperator, vipdeputy, vipadmin, revered, and superadmin to a custom check for all my VIP classes. Sadly, I cannot figure out how to add multiple ranks to one check, and multiple checks just break. Is there any way I could do this without having to duplicate the class 5 times making a different check for each one?

Also, i’ve just started getting into to lua, and I was wondering about this. so I currently have the code



hook.Add( "PreDrawHalos", "xXx_WallHacks_xXx", function()
	halo.Add( player.GetAll(), Color(255,255,255), 0, 0, 2, true, true )
	halo.Add( ents.FindByClass( "money_printer" ), Color( 255, 0, 0 ), 0, 0, 2, true, true )
end)
[/end]

This allows me to draw a white outline around the players and printers on the server through the walls. Like wallhacks. I was wondering how to make it for certain ulx ranks or how to impliment the IfAdmin part. I tried this, but it didn’t work:



hook.Add( "PreDrawHalos", "xXx_WallHacks_xXx", function()
if ply:IsAdmin then
	halo.Add( player.GetAll(), Color(255,255,255), 0, 0, 2, true, true )
	halo.Add( ents.FindByClass( "money_printer" ), Color( 255, 0, 0 ), 0, 0, 2, true, true )
else then return end
end)

ply is invalid since that’s a clientside hook. LocalPlayer() will give you the clientsided player. As for your first problem, create a table at the top of your file that looks like this:


local ranks = { -- Keep all rank names lowercase
   [ "admin" ] = true,
   [ "moderator" ] = true,
   [ "etc" ] = true,
}

Then, for your customCheck, do this:


customCheck = function( ply ) if ( ranks[ string.lower( ply:GetNWString( "UserGroup" ) ) ] ) then return true else return false end

Thanks! Can I add you on steam if I have any other small questions while I start learning lua?