BAR’s plugin system lets you extend the admin with custom commands without ever touching core files. Each plugin is a Lua ModuleScript that returns a function matching a specific contract — BAR’s MainModule discovers and loads it automatically at startup.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.
How Plugins Are Loaded
Place your plugin ModuleScripts inside a folder namedPlugins that is a direct child of the main BAR script in ServerScriptService. The main_script.lua entry point already handles discovering them: if the folder exists and contains at least one child, it is passed straight into the MainModule for processing.
Plugins folder is absent or empty the variable stays nil and BAR starts normally with only its built-in commands — no errors, no fuss.
The Plugin Contract
Every plugin ModuleScript must return a function (conventionally calledPlugin). BAR calls that function at load time and passes a single variadic argument. Inside the function, unpack the first element of the ... vararg to access eight essentials:
| Key | Type | Description |
|---|---|---|
remoteEvent | RemoteEvent | The BAR essentials RemoteEvent used to fire clients |
remoteFunction | RemoteFunction | The BAR essentials RemoteFunction for server↔client calls |
returnPermissions(player) | function | Returns a player’s permission level as an integer 0–4 |
Commands | table | The full commands dictionary — all built-in commands keyed by name |
Prefix | string | The current command prefix (default ":") |
actionPrefix | string | The action prefix (default "!") |
returnPlayers(player, arg, command) | function | Resolves a string argument (e.g. "all", "others", a username) into a list of Player objects |
cleanData(sender, receiver, data) | function | Filters and packages user data for safe transmission over the remote event |
cleanData quick reference
What Your Function Must Return
After defining your command logic, return exactly five values in this order:| Return value | Type | Description |
|---|---|---|
pluginName | string | The command name (without prefix) |
pluginFunction | function | The handler called when the command is used |
pluginLevel | number | Minimum permission level required to run the command |
pluginPrefix | string | Which prefix triggers the command (Prefix or actionPrefix) |
descTable | table | {pluginName, pluginUsage, pluginDescription} — shown in :cmds |
descTable controls how the command appears to users:
Plugins loaded this way are registered alongside every built-in BAR command and
will appear in the
:cmds list automatically. No additional registration step is
needed.Next Steps
Creating a Plugin
Step-by-step walkthrough: write your first custom plugin command from scratch using the official template.