> For the complete documentation index, see [llms.txt](https://docs.xeutrino.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xeutrino.com/getting-started/readme.md).

# Overview

Nexus ships an embedded **Lua 5.5** interpreter so you can write custom in-game scripts for the GTA V (PS4 / Orbis) mod menu. Scripts are plain `.lua` files dropped into `/data/Nexus/Scripts/` on the console — no toolchain, no SDK, just a text file.

## What you can do

| Area               | What it lets you do                                                       | Page                                               |
| ------------------ | ------------------------------------------------------------------------- | -------------------------------------------------- |
| **Menu UI**        | Build your own submenus, buttons, checkboxes and sliders inside the menu  | [UI construction](/api-reference/ui.md)            |
| **GTA V natives**  | Call any game native (`GET_PLAYER_PED(-1)`, etc.) directly from Lua       | [Native invocation](/api-reference/natives.md)     |
| **Script globals** | Read & write the game's typed global slots                                | [Script globals](/api-reference/script-globals.md) |
| **Raw memory**     | Read/write absolute addresses, patch code bytes                           | [Raw memory access](/api-reference/memory.md)      |
| **ImGui overlays** | Draw custom windows, widgets and screen-space overlays on top of the game | [ImGui rendering](/api-reference/imgui.md)         |
| **Notifications**  | Toast messages in-game                                                    | [Notifications](/api-reference/notifications.md)   |

## How scripts run

* Each script runs in its own **coroutine** on the game's script thread.
* You can `yield` at any point (`script.yield`) — even from deep inside a function — and execution resumes exactly where it left off one frame later.
* Scripts are discovered at boot and started/stopped from the **Lua Scripts** submenu.
* ImGui drawing happens on the render thread through a safe, serialised callback mechanism (see [ImGui rendering](/api-reference/imgui.md)).

> **Important — always yield** A hard instruction-limit hook (1,000,000 instructions per resume) kills any script that loops without a `yield`, surfacing a Lua error toast instead of hard-locking the game. **Always call `script.yield` inside every loop.**

## Start here

1. [Getting started](/getting-started/getting-started.md) — write and run your first script
2. [Complete worked example](/examples/worked-example.md) — a full script end-to-end
3. Browse the API reference on the left

## Quick reference

| Category | Functions                                                                                                                                                                 |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| UI       | `add_submenu`, `add_subtitle`, `add_button`, `add_checkbox`, `add_int_option`, `script.inject_submenu`                                                                    |
| State    | `get_opt`, `set_opt`                                                                                                                                                      |
| Control  | `script.yield`, `wait`, `notify`                                                                                                                                          |
| Natives  | `native.<NAME>(...)`, bare `<NAME>(...)`                                                                                                                                  |
| Globals  | `get_global_addr`, `get_global_int`, `get_global_float`, `set_global_int`, `set_global_float`                                                                             |
| Memory   | `get_app_base`, `read_int`, `write_int`, `read_float`, `write_float`, `write_bytes`                                                                                       |
| ImGui    | `imgui.add_draw`, `imgui.begin/end`, `imgui.text`, `imgui.button`, `imgui.checkbox`, `imgui.slider_float/int`, `imgui.combo`, `imgui.add_line/rect/circle/text`, and more |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.xeutrino.com/getting-started/readme.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
