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:
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.