Docs/API
API overview
Navigate the scenario Lua API by its global functions, commands, hooks, server, player, area, NPC, event, task and saved-data interfaces.
API version 1Lua 5.1Updated 2026-11-07
The scenario API is organized by the value or behavior you work with:
- Global functions: register hooks and events, schedule tasks, load modules and write to the server log.
- Chat commands and arguments: register
/namecommands and read theplayerandargsvalues. - Hooks: react to player, area, NPC and event changes.
- Server: find connected players and loaded areas, broadcast messages and run console commands.
- Player: inspect a connection, message a player, give items and teleport.
- Areas and NPCs: inspect the world, find positions, spawn or remove NPCs, and start events.
- Object placement: place and remove exported scenes and prefabs.
- Events: define and manage custom events.
- Tasks: inspect or cancel scheduled Lua work.
- Saved data: persist scenario-owned values across reloads and restarts.
Found a mistake or missing detail? Tell us in the Discord.
rtv-mp