> For the complete documentation index, see [llms.txt](https://docs.rainmad.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rainmad.com/resources/3d-interactive-minigames-bundle/installation.md).

# Installation

### 1. Drop in the resource

Place the `rm_3dminigames` folder in your resources directory, then add it to `server.cfg` **after** `ox_lib` and `rm_stream`:

```cfg
ensure ox_lib
ensure rm_stream
ensure rm_3dminigames
```

{% hint style="warning" %}
Load order matters. `rm_stream` provides the runtime DUI textures that back the tablet and monitor placements. If `rm_3dminigames` starts first, prop and monitor modes will silently fail to render.
{% endhint %}

***

### 2. Stream assets

The tablet prop `rm_tablet_02` is bundled in the `stream/` folder and streams automatically. Nothing to copy, nothing to add to your `[stream]` folder.

If you already run another script that ships a prop with the same name, keep one copy. Two identical models loaded from different resources will spam `DUPLICATE_ARCHETYPE` warnings.

***

### 3. Verify

Start the server and check the console. You should see something like:

```
[rm_3dminigames] 33 minigames registered
[rm_3dminigames] hack types loaded: fingerprint, laptop, tablet, tablet_wall, laptop_open, monitor
```

Then in game, with permission (see step 4):

```
/test_minigame screen untangle
```

A fullscreen minigame should open. Solve it or press Backspace to cancel. If the console prints `[test_minigame] untangle -> true` you are done.

{% hint style="info" %}
`/test_minigame` bypasses hack point placement entirely. It is the fastest way to confirm the React bundle loads before you start dropping props into the world.
{% endhint %}

***

### 4. Grant yourself admin

`/create_minigame`, `/remove_minigame` and `/test_minigame` are all admin-gated. Out of the box, permission is checked against the ACE `command.create_minigame`. Give it to yourself in `server.cfg`:

```cfg
add_ace identifier.discord:123456789012345678 command.create_minigame allow
```

Prefer a straight identifier whitelist? Open `cfg.lua` and add yours:

```lua
cfg.hacks.adminWhitelist = {
    'discord:123456789012345678',
    'license:abcdef0123456789abcdef0123456789abcdef01',
}
```

Both mechanisms are OR'd, so ACE **or** whitelist match lets a player through. See cfg.lua Reference for the full identifier list.

{% hint style="danger" %}
If you leave `adminAce` set to `command.create_minigame` and never grant it, nobody can place hack points, including you. Either grant the ACE, add yourself to the whitelist, or set `adminAce = ''` for testing.
{% endhint %}

***

### 5. Place your first hack point

In game, walk to where you want it, look at the ground, then:

```
/create_minigame
```

An `ox_lib` dialog opens.

1. Give the point a **label**, anything short.
2. Pick a **hack type** from the dropdown (fingerprint, laptop, tablet, and so on, see Hack Types).
3. Pick a **minigame**.
4. Pick a **difficulty**, or leave it on default.

A preview prop spawns in front of you and a three.js gizmo attaches to it. Drag the arrows to move, the rings to rotate. Left-click empty space to confirm.

The point is written to `data/saved_minigames.lua` and is live immediately. Walk within `pointRadius` (default 1.5m) and the `[E] Hack` prompt appears.

***

### 6. Controls

| Input            | Action                                                   |
| ---------------- | -------------------------------------------------------- |
| `E`              | Start hacking the point you are looking at               |
| `Backspace`      | Cancel a running minigame                                |
| Gizmo mouse-drag | Move / rotate the preview prop during `/create_minigame` |
| Left-click empty | Confirm placement                                        |
| `Esc`            | Cancel placement, deletes the preview                    |

Keybinds inside a minigame are minigame-specific. See Minigames for per-game controls.

***

### 7. Backup and edit

`data/saved_minigames.lua` is auto-written on every `/create_minigame` and `/remove_minigame`. It is a plain Lua file with a single `SavedMinigames = { }` table, safe to open, diff, commit and hand-edit **between restarts**.

{% hint style="warning" %}
Do not edit the file while the resource is running. The server rewrites it on the next placement change and your edits will be lost.

If you want manual control, set `cfg.hacks.autoSave = false`. The commands still work, but the file is never touched, so you own it.
{% endhint %}
