Old School Ops

Lua Modules

Extending an RF server without its source. What a module is, where it goes, and a working module in five minutes.

Applies to RF Online 4.55RF Online 4.15RF Online 1.5RF Online 2.2.3.2 · updated 2026-11-06
On this page

A module is one Lua file in your server's scripts/modules folder. It listens to what happens in the game (a login, a kill, a level up, a Chip War result), can refuse or adjust a few things as they happen (an auction listing, a chat line, a pickup, a hit), adds staff and player commands and timers, keeps its own data, and acts through the server's own helpers: announcements, notices, mail, items, currency, buffs and warps.

Modules are how you customise a server without its source. RF Online: Dragonborn, RF Online: Age of Patron, RF Online 1.5 and RF Online: Golden Age run them today.

What Is in the Folder

filewhat it is
scripts/modules/_template.luaa small working module to copy; the leading _ keeps the server from loading it
scripts/modules/examples/complete modules for common features; the server never loads this folder

Switching Modules Off

Modules are on by default (lua.enabled), and a server with nothing in the folder does nothing extra. To stop every module, set lua.enabled to off on the GameCP's Settings page, under Lua Modules. Every event, gate, command and timer stops within ten seconds, with no restart.

Quick Start

You need a character at staff level 3 (Administrator). GM Accounts explains the levels.

  1. Copy scripts/modules/examples/staff_presence.lua up one folder, into scripts/modules/.
  2. In game, type %mod reload. The reply says how many modules loaded and names any problem.
  3. Type %mod list. The module is listed with its commands.
  4. Type .staff in any chat channel. The module answers with the staff online.

Your First Module

Save this as scripts/modules/welcome_back.lua:

module "welcome_back" {
  api = 1,
  title = "Welcome back",
  version = 1,

  settings = {
    greeting = { kind = "text", max = 120, default = "Welcome back!", doc = "what a returning player sees" },
  },

  on = {
    login = function(m, ev)
      if not ev.first then
        rf.notice(ev.player.id, m:setting("greeting"))
      end
    end,
  },
}

Then type %mod reload, log a character out and back in, and read the system line. Change the text without touching the file:

%mod set welcome_back greeting Good to see you again.

To start from something larger, copy _template.lua to a new name without the underscore, rename the module inside it, and delete the parts you do not need.

The Rest of the Manual

pageholds
Writing a Modulethe file, its parts, reloading, timers
Settings and Commandsvalues an operator changes; staff and player commands
Eventswhat a module can listen to, with every field
Gateswhat a module can refuse or change as it happens
Verbseverything a module can call
Storagebags and custom tables
New Messagesnew wire messages for GoMMO Client
Examplesthe shipped modules, and what each one shows
Running Moduleserrors, limits, the %mod commands, server settings, troubleshooting

Where the versions differ: Dragonborn, Age of Patron, RF Online 1.5 and Golden Age.

Something here wrong?

Out of date, incomplete, or assuming something it should not. Documentation errors are bugs, and this one arrives tagged and pointed at this page.

Top xp sources

How xp works
Loading…

Open the full search page