> For the complete documentation index, see [llms.txt](https://code-after-sex.gitbook.io/script-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://code-after-sex.gitbook.io/script-documentation/cas-roulette/install.md).

# Installation

Install CAS Advanced Roulette System on a VORP or RSG RedM server: the two folders, the server.cfg order, admins, and restarting safely with players in game.

[Back to the guide](/script-documentation/cas-roulette/cas-advanced-roulette-system.md)

## 1. The two folders

The download has two folders. Put both in your server's resources, for example `resources/[cas]/`:

| Folder                | What it is                                                  |
| --------------------- | ----------------------------------------------------------- |
| `cas-roulette-assets` | the table and wheel models, built from the game's own files |
| `cas-roulette`        | the game: tables, croupiers, betting, rounds, money, HUD    |

Keep the folder names. The game loads its models from `cas-roulette-assets`, its events start with `cas-roulette:` and the HUD is served from `cas-roulette`.

## 2. server.cfg

Start both after your framework, the assets first:

```cfg
# VORP
ensure vorp_core
# ... the rest of your framework ...
ensure cas-roulette-assets
ensure cas-roulette
```

```cfg
# RSG
ensure rsg-core
# ... the rest of your framework ...
ensure cas-roulette-assets
ensure cas-roulette
```

## 3. Admins

Give your admins the ace:

```cfg
add_ace group.admin casroulette.admin allow
```

Or list framework groups in `Config.AdminGroups` (VORP user group or RSG permission; by default `admin` and `superadmin`).

## 4. Restart the server

There is no SQL to import and no item to add. The script keeps its records in its own storage (KVP).

## Restarting

* `cas-roulette` can be restarted at any time, also with players in game (config changes, updates). A round that is running is called off and every bet goes back to its owner.
* Never restart or stop `cas-roulette-assets` while players are in game. Unloading streamed models under props that are in use can crash their game. Restart the server instead.
* If `cas-roulette-assets` starts for the first time while players are in game, they may only see the models after they reconnect.

## Check it

1. Walk to a table: La Bastille in Saint Denis (upstairs parlour) or the Valentine saloon (front left corner, by the piano). The map shows a blip at each table.
2. Stand at a free place at the rail. "Join the Table" appears with the table limits. Hold E.
3. Place a chip with a left click and wait for the spin.

Admins can jump to a table with `/roulette_tp` and list the tables with `/roulette_tables`. See [Commands](/script-documentation/cas-roulette/commands.md).
