Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Verveo/Basic-Admin-Remade/llms.txt

Use this file to discover all available pages before exploring further.

A BAR plugin is a Lua ModuleScript placed in a Plugins folder inside the main BAR script. It defines a single custom command — its name, permission level, prefix, and the function to run when a player triggers it. Because BAR discovers plugins at startup, you never need to touch any core file.
1

Create the Plugins folder

In ServerScriptService, locate your BAR script (the model you placed there during setup). Insert a new Folder as a direct child of that script and name it exactly Plugins.
2

Insert a ModuleScript

Inside the Plugins folder, insert a new ModuleScript. Give it a descriptive name (e.g. AnnouncePlugin) — the name of the ModuleScript itself is not used by BAR, only the values you return from the function matter.
3

Write the plugin code

Replace the default ModuleScript contents with your plugin, following the contract shown in the template below. The Plugin Contract section of the overview explains every value BAR expects you to return.
4

Playtest

Hit Play in Studio (or publish and start a live server). Your command will be registered automatically and will appear in :cmds alongside all built-in commands.

Official Plugin Template

The file below is the unmodified plugin_script.lua shipped with BAR. Copy it as your starting point.
local Plugin = function(...)
	local Data = {...}

	-- Included Functions and Info --
	local remoteEvent = Data[1][1]
	local remoteFunction = Data[1][2]
	local returnPermissions = Data[1][3]
	local Commands = Data[1][4]
	local Prefix = Data[1][5]
	local actionPrefix = Data[1][6]
	local returnPlayers = Data[1][7]
	local cleanData = Data[1][8] -- cleanData(Sender,Receiver,Data)
	-- Practical example, for a gui specifically for a player, from another player
	-- cleanData(Sender,Receiver,"hi") -- You need receiver because it's being sent to everyone
	-- Or for a broadcast (something everyone sees, from one person, to nobody specific)
	-- cleanData(Sender,nil,"hi") -- Receiver is nil because it is a broadcast

	-- Plugin Configuration --
	local pluginName = 'help'
	local pluginPrefix = actionPrefix
	local pluginLevel = 0
	local pluginUsage = "" -- leave blank if the command has no arguments
	local pluginDescription = "Calls for an in-game admin."

	-- Example Plugin Function --
	local function pluginFunction(Args) -- keep the name of the function as "pluginFunction"
		local Player = Args[1]
		for i,v in pairs(game.Players:GetChildren()) do
			if returnPermissions(v) >= 1 then
				remoteEvent:FireClient(v,"Notif",Player.Name.." has called an admin!", Player.Name..' needs an admin!',{'Message',Player.Name..' has called an admin!',' \t'})
			end	
		end

	end

	-- Return Everything to the MainModule --
	local descToReturn
	if pluginUsage ~= "" then
		descToReturn = pluginPrefix..pluginName..' '..pluginUsage..'\n'..pluginDescription
	else
		descToReturn = pluginPrefix..pluginName..'\n'..pluginDescription
	end

	return pluginName,pluginFunction,pluginLevel,pluginPrefix,{pluginName,pluginUsage,pluginDescription}
end

return Plugin

Template Breakdown

pluginName

The command name without its prefix. Whatever string you set here is what players type after the prefix to trigger the command.
local pluginName = 'help'   -- triggered by !help (or :help depending on pluginPrefix)

pluginPrefix

Which prefix character activates the command. Set it to:
  • actionPrefix — uses ! (the action prefix, e.g. !help)
  • Prefix — uses : (the standard admin prefix, e.g. :help)

pluginLevel

The minimum permission level a player must have to run the command. BAR uses four levels above the default:
ValueRole
0Everyone (no admin required)
1Moderator
2Admin
3Super Admin
4Creator (game owner only)

pluginUsage

A short argument description displayed next to the command name in :cmds. Leave it as an empty string ("") if the command takes no arguments.
local pluginUsage = "<player> <reason>"   -- shown in :cmds as :ban <player> <reason>
local pluginUsage = ""                    -- command takes no arguments

pluginDescription

A one-line description of what the command does. Shown alongside pluginUsage in :cmds.

pluginFunction(Args)

The handler that runs when the command is triggered. Always keep the function named pluginFunction — BAR expects that exact identifier when registering the command. The Args table is structured as follows:
IndexValue
Args[1]The Player object who typed the command
Args[2]The command name (string)
Args[3]+Any additional arguments the player provided

The return statement

The final return at the bottom of the Plugin function ships everything BAR needs to register your command. All five values are required — do not omit any of them.
return pluginName, pluginFunction, pluginLevel, pluginPrefix, {pluginName, pluginUsage, pluginDescription}

Real-World Example: :announce <text>

The following plugin adds a :announce <text> command (admin-only) that fires a server-wide notification to every connected player.
local Plugin = function(...)
	local Data = {...}

	local remoteEvent      = Data[1][1]
	local remoteFunction   = Data[1][2]
	local returnPermissions = Data[1][3]
	local Commands         = Data[1][4]
	local Prefix           = Data[1][5]
	local actionPrefix     = Data[1][6]
	local returnPlayers    = Data[1][7]
	local cleanData        = Data[1][8]

	local pluginName        = 'announce'
	local pluginPrefix      = Prefix           -- triggered with :announce
	local pluginLevel       = 2                -- admins and above only
	local pluginUsage       = '<text>'
	local pluginDescription = 'Broadcasts a server-wide announcement.'

	local function pluginFunction(Args)
		local sender  = Args[1]
		local message = table.concat(Args, ' ', 3) -- join everything after the command name

		if message and message ~= '' then
			for _, player in pairs(game.Players:GetChildren()) do
				-- cleanData with nil receiver = broadcast to everyone from sender
				remoteEvent:FireClient(
					player,
					'Notif',
					'Announcement',
					sender.Name .. ': ' .. message,
					{'Message', sender.Name .. ': ' .. message, ' \t'}
				)
			end
		end
	end

	return pluginName, pluginFunction, pluginLevel, pluginPrefix, {pluginName, pluginUsage, pluginDescription}
end

return Plugin
Call returnPermissions(player) inside pluginFunction whenever you need to gate part of your logic on a player’s rank — for example, to let admins target other admins but not super admins. The function returns an integer 04 that you can compare directly with >=, ==, etc.
Treat returnPermissions, Commands, and all other values unpacked from Data[1] as read-only. Never reassign or mutate these tables. Modifying them will corrupt BAR’s internal state for the entire server session and may silently break unrelated commands.
The !help example bundled in plugin_script.lua is a practical demonstration of returnPermissions in action. When a player runs !help, the handler iterates over every online player and fires a notification only to those whose permission level is >= 1 (i.e. moderators and above). This makes it easy to page all active admins without exposing their identities to regular players.

Build docs developers (and LLMs) love