This module is used to define the conditions that a player must meet to be able to perform certain actions, and it evaluates these conditions in real-time during gameplay. This adds an additional layer of customization and control over player actions, enhancing the game's overall experience.
Creates a new QuickPerms evaluator function, which can now be used in the following way:
local Applicable = QuickPerms(Player, PermissionCheckType, PermissionChecks)
Evaluates whether the Player meets the expression you provide.
PermissionCheckType
All: The player must meet ALL of the PermissionChecks.
Any: The player must have at least one of the PermissionChecks.
Exclusive: The player must have only one of the PermissionChecks.
None: The player must not match any of the PermissionChecks.
Using the available PermissionCheckTypes, any logic needed can be created (in the same way logic gates do).
PermissionChecks
This argument is a list of PermissionChecks, each permission check should follow the following format:
{CheckType, Arguments...}
CheckTypes
Player
Player checks if the user's property matches your desired value, you can use this to check if a player has a certain UserID.
EG:
{"Player", "UserId", 10452609332}
SUMMARY:
{"Player", PropertyName, PropertyDesiredValue}
Function
Function is a way to use custom functions and return whether the player passed the permission, you can have as many paramaters if you want in the function however the first one must always be the player, when you are using this function. After you have defined the function you can pass things to it as shown below.
EG:
{"Function", function(Player, A, B) return (A or B) end, false, true}
SUMMARY:
{"Function", function, paramater, paramater, paramater, par...
The main use of this would be allowing your users to connect an external system without having to remove QuickPerms.
Group
Group checks if a user is in a group, you can also provide minimum and maximum rank IDs, set the minimum and maximum rank ID to the same to allow only one rank ID through the permission check. Set the minimum or maximum rank IDs to false to let the module ignore the value.
EG:
{"Group", 10136926}
{"Group", 10136926, 100}
{"Group", 10136926, 255, 255}
SUMMARY:
{"Group", GroupID, MinimumRank, MaximumRank}
Game Creator
Game Creator checks if the user is the creator of the game.
EG:
{"GameCreator"}
SUMMARY:
{"GameCreator"}
Friends
Friends checks if the user is friends with the provided user, you can also pass an expected value to say whether you want to only allow users who are friends or only allow users who are not friends.
EG:
{"friends", 3010955430}
{"friends", 3010955430, false} -- Do not allow friends of 3010955430.
SUMMARY:
{"friends", FriendsWithUserID, ExpectedValue}
Check Permissions
You can give this function another permission list, this is usefull if users must either have one permission or all of the others, here's an example any check where CheckPermissions is useful.
. CHECK PERMISSIONS (ALL) ---Has played for longer than an hour. ---Has over 30,000 cash. ---Is in the group. . BOUGHT PRO GAMEPASS
EG:
local PermissionList = {
{"Player", "Name", "Alexplazz"},
{"Team", "MODs"},
{"checkpermissions", "Any", {
{"gamecreator"},
{"friends", 3010955430}
}}
}
SUMMARY:
{"CheckPermissions", PermissionCheckType, PermissionList}
HD Admin Rank
Group checks if a users HD rank is above 0, you can also provide a maximum and minimum rank in the same way you do with "GROUP".
EG:
{"hdadminrank"}
{"hdadminrank", 4}
{"hdadminrank", 3, 4}
SUMMARY:
{"hdadminrank", MinimumRankID, MaximumRankID}
Do not use without HD Admin installed, HD admin can be glitchy on initial start up so it is not recommended to use this function on any early events like PlayerAdded.
NOTE: Though also created by me, QuickPerms existed before AsyncAdmin. AsyncAdmin uses QuickPerms to get the players rank as soon as they join, which HDAdmin won't allow (as it's not loaded yet, a problem on their side).