In order to do this, you’ll need to insert a copy of the MainModule and manually modify it to have this ability. It is important to note that in doing this, you will no longer receive automatic updates, such as bug fixes, security patches, and new features, to the version of Basic Admin in your game.
If you don’t have a copy of the module, you’ll need to take one here, and once you have it in your inventory, you unfortunately cannot insert it through Toolbox, so you’ll have to run this code in your command bar to insert it into your game.
game.InsertService:LoadAsset(563619835).Parent = workspace
When you run this code, it’ll insert a model with the MainModule in it into workspace.
You’ll want to drag the MainModule into the Basic Admin script so that it is parented to the script, then delete the empty model that is left behind.
Now open the MainModule and press Control+F, which will open the find menu, where you’ll paste “insertPermissions” (without quotation marks). This will bring you to the function you need to modify in order to give players admin if they own a certain gamepass.
In this function, you can paste the following code, and modify it slightly to suite your needs:
pcall(function()
local GamepassId = 9366750
-- Id of the gamepass
local GamepassAdminLevel = sysTable.Permissions.Mods
-- Determins which admin level will be given to the user if they own the gamepass.
-- The options are:
-- sysTable.Permissions.gameOwners
-- sysTable.Permissions.superAdmins
-- sysTable.Permissions.Admins
-- sysTable.Permissions.Mods
local OwnsGamepass = Market:UserOwnsGamePassAsync(Player.UserId, GamepassId)
-- Checks to see if they own the gamepass
if OwnsGamepass == true then
if returnPermission(Player) < GamepassAdminLevel[1] then
GamepassAdminLevel[2][tostring(Player.UserId)] = Player.UserId
-- Gives the user admin
end
end
end)
Your end result will look something like this:
There’s one last step, which is to modify your loader script to reference your MainModule instead of mine. Locate the loader script, which should be the parent of the MainModule script that you just got done editing.
Open the script, and scroll down until you see Loader ID.
Change 563619835
to script.MainModule
And now players who own a certain gamepass will automatically be given whichever admin level you specified to give them.