ULX

Author Topic: ULX Group help  (Read 1372 times)

0 Members and 1 Guest are viewing this topic.

Offline Shotz

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
ULX Group help
« on: June 10, 2022, 12:26:05 AM »
So, me and my friend have a store for our GMOD server. We want to make PAC3 buyable but to do that we need to make a group. The issue is, if someone buys a package that doesn't have PAC3 included they will be removed from that group and no longer have PAC3. What can I do? Is there anyway to make them have permanent features after buying?

Offline iViscosity

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 802
  • Karma: 58
Re: ULX Group help
« Reply #1 on: June 10, 2022, 12:52:42 AM »
What do you mean you need to make a group for them to use PAC? If you're using something like Pointshop, you shouldn't need to make a new group iirc. If you're using your own custom shop, just use something like CheckGroup or IsUserGroup
I'm iViscosity. I like gaming and programming. Need some help? Shoot me PM.

Offline Shotz

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: ULX Group help
« Reply #2 on: June 10, 2022, 01:28:04 AM »
This is the code I need to use to restrict pac3 to certain groups:
Code: [Select]
-- add/change rank names here in the same format
local ranks = {
["pac3"] = true,
["owner"] = true,
["admins"] = true,
["superadmin"] = true,
}
    CustomCheckFailMsg = "Donators only",
hook.Add("PrePACEditorOpen", "PACRankRestrict", function(ply)
if not ranks[ply:GetUserGroup()] then
              return false,"Insufficient rank to use PAC."
        end
end)

I want to make it so if they buy PAC3 Package they have it permanently so when they buy another package it doesn't get removed.