ply:IsUserGroup help

So I have a custom function that uses this

if calling_ply:IsUserGroup( “Owner” ) then[/lua]

but I need it work with multiple groups like this

if calling_ply:IsUserGroup( “Owner”, “Head Admin”, “Server Manager”, “Helper”, “admin”, “superadmin” ) then[/lua]

But as you may know, it doesn’t work. How do I make it so it checks the multiple groups?

[del]it accepts strings so i assume you could do some sort of array with it and take all of the strings from the array (idk, im probably explaining it badly and i suck at lua but i assume something like that could work)[/del]


use a table or, or

if calling_ply:IsUserGroup(“owner” || calling_ply:IsUserGroup(“admin”) ) then

i recommend a table

Maybe you can use:
ply:CheckGroup( <lowest group in your list here> )

For example if you have groups such as

Head Admin


then you will use ply:CheckGroup(“Helper”) and it will return true if the player is in Helper group or “above”

Otherwise, if you want to check for just groups in your list, then I would use a table, like this:
local allowedGroups =
[“Owner”] = true,
[“Head Admin”] = true,
[“Server Manager”] = true,
[“Helper”] = true,
[“admin”] = true,
[“superadmin”] = true,

if allowedGroups[ ply:GetUserGroup() ] then – player is in one of the allowed groups

Oops, fixed :stuck_out_tongue:

The above wouldn’t work, because that’s searching for the key of the usergroup where in the table the group is the value. To make it work you would need to use table.HasValue which is more resource intensive than my suggestion below.

Table Example:
local ranks = {
Owner = true,


if ranks[calling_ply:GetUserGroup()] then


Thank you Jarva, works perfect. I really appreciate the help.

Last I checked, Ulysees didn’t allow spaces in group names