Get started
Reference for Lua scripts loaded through Scripts > Library: runtime, lifecycle, callbacks, namespaces, objects and script UI.
Learn
How a script runs, loads and reacts to the game.
Build
The API a script calls.
Looking for one name? The API index lists every named function, callback, constant, method and type, each linked to its reference section.
API indexStart from a task
Pick what the script does. Each card opens the page that covers it.
Pick a namespace
Every namespace has its own page with signatures, return values and errors.
Start from an example
Complete scripts to copy and change.
Quick start
Save the following file as watermark.lua in %SystemDrive%\nix\scripts\, then load it from Scripts > Library.
-- @name Watermark
-- @author you
-- @version 1.0
-- @description Displays the script name in the top-left corner.
local white = color(255, 255, 255)
local position = vector2d(16, 16)
events.render(function()
render.text(utils.script_name(), position, white)
end)Scripts are read from disk on load. After editing a loaded script, use Reload to apply the changes.
How the reference is written
- Every function has a signature block, then Returns and, where applicable, Errors. The notation is defined in Signature notation.
- Each namespace and each object type has its own page, so a page can be read on its own.
- Links between pages are absolute paths; heading anchors are stable.
Machine-readable access
The documentation is served as Markdown for AI agents and MCP clients. The site is static: every resource below is a plain file, and paths are relative to this site.
| Resource | Content |
|---|---|
/llms.txt | Index of every page with its one-line description. Start here to choose a page. |
/llms-full.txt | The whole documentation in one Markdown file. |
<page>.md | One page as Markdown, for example /namespaces/render.md or /objects/trace_t.md. The start page is /index.md. |
/v1/llms.txt, /v1/llms-full.txt | The same two files for v1, the previous API. Its pages live under /v1/ and are served as Markdown the same way. |
To answer a question about one symbol, look it up in the API index and fetch the linked page; avoid loading /llms-full.txt unless the whole reference is needed. Everything outside /v1/ describes the current API (v2); use v1 pages only for scripts written against the previous API.
