Need help with a ulx thing

Hi i am trying to make it where only certain groups can use pac 3 and i just cant figure it out ive all ready tried this

local allowedgroups = {
“donator”,
“donator+”,
“elite”,
“moderator”,
“admin”,
“superadmin”
}

hook.Add(“PrePACConfigApply”, “DonatorRestrict”, function(ply, outfit_data)
if (!table.HasValue(allowedgroups, ply:GetUserGroup())) then
return false, “PAC3 is restricted.”
end
end)

and it didnt work any help would be helpful.

I’m writing this on the phone so sorry for indention errors.
[lua]allowedGroups = {
[“Group1”] = true,
[“Group2”] = true
}

hook.Add(“PrePACConfigApply”, “DonatorRestrict”, function(ply, outfit_data)
if not allowedGroups[ply:GetUserGroup()] then
return false, “PAC3 Is Restricted”
end
end)[/lua]
Try that. You can set up the table such as I did and negate the whole Table Has Value. Place it in server-side only.