Question on Basic Admin Essentials 2.0

Hi, I’m trying to sell Basic Admin in my game! My script allows the player who owns the gamepass to appear in the :admins list, but doesn’t actually give them mod, also their name doesn’t appear in :ingameadmins. Can someone please help me figure out what is wrong with my script?

game.Players.PlayerAdded:connect(function(plr)
    if 
game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId,9366750) then
        table.insert(Configuration.Mods,plr.Name)
    end
end)
6 Likes

I’m not sure how the admin script works, but it’s likely that it is initializing the settings at the beginning of the game and never accessing them again. You’re modifying the settings after the script has initialized them, however the script is never checking to see your changes. Does BA not have a built in system for granting mod permissions via a gamepass?

2 Likes

Are you editing the main module?

3 Likes

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.

image

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.

image

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.

image

image

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.

image

Open the script, and scroll down until you see Loader ID.

image

Change 563619835 to script.MainModule

image

And now players who own a certain gamepass will automatically be given whichever admin level you specified to give them.

16 Likes

tysm i was trying to figure this out for a while!! :smiley:

can you tell me how to make a command which displays copy and paste logs @TheFurryFish

There is a copy paste log module going around the sell-it-around market, search for it and you’ll find it.