Skip to main content
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.

How Plugins Are Loaded

Place your plugin ModuleScripts inside a folder named Plugins 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.
If the 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 called Plugin). 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:

cleanData quick reference

What Your Function Must Return

After defining your command logic, return exactly five values in this order:
The 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.