> For the complete documentation index, see [llms.txt](https://organized-chaos.gitbook.io/organized-chaos-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://organized-chaos.gitbook.io/organized-chaos-docs/chess/installation.md).

# Installation

Install Chess and put up your first table.

{% stepper %}
{% step %}

### Add the resource

Put the `chess` folder into your `resources` folder. See [Installation basics](/organized-chaos-docs/installation-basics.md) for the download and the licence key.
{% endstep %}

{% step %}

### Start it

Add it to your `server.cfg`, after your framework and `ox_target` if you use them:

```cfg
ensure chess
```

{% endstep %}

{% step %}

### Add the table item (optional)

For players to put up tables themselves, run `install/esx_items.sql` (ESX) or add the `chess_table` line for QBCore or ox\_inventory to your item list. See [Table item](/organized-chaos-docs/chess/table-item.md).
{% endstep %}

{% step %}

### Restart the server

A table now stands on Legion Square, with a demo board on an easel beside it. Walk up to a chair and press **E**.
{% endstep %}

{% step %}

### Place more tables

Stand where the table should go and type `/chess_place`, or `/chess_place marble` (or `ebony`, `metal`, `glass`, `neon`) for another [look](/organized-chaos-docs/chess/table-looks.md). The table appears two metres in front of you, and you are standing on White's side. See [Commands and permissions](/organized-chaos-docs/chess/commands-and-permissions.md) for who may use the command.
{% endstep %}
{% endstepper %}

## Optional resources

| Resource                               | Effect                                                                                                                                                                                              |
| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ox_target`                            | Players aim at a chair to sit down, or at the table to watch, and at a table of the item to pick it up. Set `Config.Target = false` to keep the key prompts                                         |
| `qbx_core`, `qb-core` or `es_extended` | Character names are shown, ratings and winnings belong to the character, games can be played for a stake (`Config.BuyIn`), and looks can be kept for a job. `Config.Framework` chooses between them |
| `ox_inventory`, or one of the three    | The table item, and looks kept for the owners of an item. See [Table item](/organized-chaos-docs/chess/table-item.md)                                                                               |

They have to start before `chess`.

Without one of the three frameworks, the stake also works with the cash from `ox_inventory` alone, or with functions of your own. See `Config.Framework` in the [Configuration](/organized-chaos-docs/chess/configuration.md).

## Moving the default table

The table on Legion Square comes from `Config.Tables` in `config.lua`. Change its coordinates, add more entries, or empty the list and place every table in game:

```lua
Config.Tables = {
    { coords = vector3(191.93, -931.42, 30.69), heading = 144.0 },
}
```

`coords` is the centre of the table on the ground. `heading` is the way White faces. Add `skin = 'marble'` (or `'ebony'`, `'metal'`, `'glass'`, `'neon'`) for another look.

The demo board beside it comes from `Config.LeaderboardBoards`. Set it to `{}` for none, or `Config.BoardStyle = 'panel'` for the leaderboard panel of older versions instead. See [Leaderboard and demo board](/organized-chaos-docs/chess/leaderboard.md).

## Updating from 1.2

Replace every file except `config.lua`, `config_server.lua`, `locales.lua`, the two export files and the files the resource writes (`tables.json`, `stats.json`, `owed.json`, `games.pgn`). Then take two lines from the new `config.lua` into yours:

```lua
Config.TableSkins = { 'marble', 'ebony', 'metal', 'glass', 'neon' }
Config.BoardStyle = 'easel'
```

The new models (three table looks and the easel) are in `stream/` and loaded by `fxmanifest.lua`, so restart the server rather than only the resource. Without `Config.BoardStyle` in your config the boards in the world become demo boards; set it to `'panel'` to keep the leaderboard panel.

## Updating from 1.1

Replace every file except `config.lua`, `config_server.lua`, `locales.lua`, the two export files and the files the resource writes (`tables.json`, `stats.json`, `owed.json`, `games.pgn`). Then add the new options to your `config.lua` from the new one: the looks, the computer's personalities, the review, the puzzles, the leaderboard, the table looks and the demo board. `locales.lua` has new texts too. `Config.BotLevel` of 1.1 still works.
