> For the complete documentation index, see [llms.txt](https://mole-resource.gitbook.io/mole-resource-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mole-resource.gitbook.io/mole-resource-docs/scripts/hanoi-tower/gameplay.md).

# Gameplay

## Placing a Board

Use the **Tower of Hanoi** item from your inventory to enter placement mode. A translucent preview of the board follows your cursor.

<table><thead><tr><th width="220">Control</th><th>Action</th></tr></thead><tbody><tr><td>🖱️ <strong>Mouse</strong></td><td>Aim — the preview sticks to the surface under the cursor</td></tr><tr><td>🖱️ <strong>Scroll</strong></td><td>Rotate the board (15° steps)</td></tr><tr><td>🖱️ <strong>Left Click</strong></td><td>Confirm placement</td></tr><tr><td>⌨️ <strong>ESC</strong></td><td>Cancel (item stays in your inventory)</td></tr><tr><td>⌨️ Backspace</td><td>Cancel (item stays in your inventory)</td></tr></tbody></table>

{% hint style="info" %}
The board can be placed on any surface — floors, tables, counters. It snaps to the ground properly on confirm.
{% endhint %}

***

## Board Interaction

Walk up to a placed board (within 2 m):

<table><thead><tr><th width="220">Control</th><th>Action</th></tr></thead><tbody><tr><td>⌨️ <strong>E</strong></td><td>Start playing</td></tr><tr><td>⌨️ <strong>G</strong></td><td>Pick the board up (returns the item)</td></tr></tbody></table>

{% hint style="warning" %}
A board cannot be picked up while someone is playing on it. Server-owned boards (from `Config.Boards`) can never be picked up.
{% endhint %}

{% hint style="info" %}
With `Config.Target` set to `ox_target` or `sleepless_interact`, the **E**/**G** prompts are replaced by *Play* and *Pick up* options in your targeting system.
{% endhint %}

***

## Playing the Puzzle

The goal: move the whole tower from the **left peg** to the **right peg**. Only one disk moves at a time, and a larger disk can never rest on a smaller one.

### Camera mode (default on entry)

<table><thead><tr><th width="220">Control</th><th>Action</th></tr></thead><tbody><tr><td>🖱️ <strong>Mouse</strong></td><td>Orbit the camera around the board</td></tr><tr><td>🖱️ <strong>Scroll</strong></td><td><strong>Before the first move:</strong> change disk count (3–7)<br><strong>After the first move:</strong> zoom in / out</td></tr><tr><td>⌨️ <strong>SPACE</strong></td><td>Lock the camera → switch to cursor mode</td></tr></tbody></table>

### Cursor mode (camera locked)

<table><thead><tr><th width="220">Control</th><th>Action</th></tr></thead><tbody><tr><td>🖱️ <strong>Mouse</strong></td><td>Aim — hovering a selectable disk highlights it</td></tr><tr><td>🖱️ <strong>Left Click</strong> (on a disk)</td><td>Pick up the top disk of a peg</td></tr><tr><td>🖱️ <strong>Left Click</strong> (on a peg)</td><td>Place the held disk — a <mark style="color:green;">green</mark> ghost preview means the move is legal, <mark style="color:red;">red</mark> means it is not</td></tr><tr><td>🖱️ <strong>Left Click</strong> (same peg)</td><td>Put the disk back / cancel selection</td></tr><tr><td>⌨️ <strong>SPACE</strong></td><td>Unlock the camera → back to camera mode</td></tr></tbody></table>

### Anytime

<table><thead><tr><th width="220">Control</th><th>Action</th></tr></thead><tbody><tr><td>⌨️ <strong>R</strong> (hold 2 s)</td><td>Reset the board — a progress bar fills at the bottom of the screen</td></tr><tr><td>⌨️ <strong>BACKSPACE</strong></td><td>Exit the game</td></tr></tbody></table>

***

## Timer & Move Counter

A HUD at the top of the screen shows the **match timer** and **move counter**.

* The timer starts on the **first move** of your session
* Leaving the game **pauses** the timer; it resumes on your next move after re-entering
* The counter and timer belong to the **board**, not the player — if someone else continues an unfinished puzzle, they inherit the current time and move count
* Both reset on: **win**, **manual reset (R)**, or **changing the disk count**

***

## Multiplayer Rules

* **One player at a time** — the board locks while someone plays; others get a notification when trying to enter
* **Spectating** — with `Config.Live = true`, bystanders see every move in real time; with `false`, the board visually updates when the player wins, resets, or leaves
* **Unfinished puzzles persist** — the exact disk layout, move count, and time survive relogs and server restarts; anyone can continue an abandoned game
* **Disconnects are safe** — if the player crashes or quits mid-game, the lock is released automatically and every move made so far is already saved
