Skip to Content

Get started

Reference for Lua scripts loaded through Scripts > Library: runtime, lifecycle, callbacks, namespaces, objects and script UI.

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

ResourceContent
/llms.txtIndex of every page with its one-line description. Start here to choose a page.
/llms-full.txtThe whole documentation in one Markdown file.
<page>.mdOne 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.txtThe 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.

On this page