> 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/tables.md).

# Tables

CAS Advanced Roulette System tables in RedM: the La Bastille and Valentine defaults, your own tables in config, tables added in game, casino MLOs and the streamed models.

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

## The default tables

Rockstar never placed a roulette table in the world, so the two default tables stand at spots picked from the saloon interiors. None of the saloons has an empty 4 x 3.2 m floor, so each table hides a few of the interior's own props while it is loaded:

| Table                              | Where                                                | Hidden while the table is loaded                          | Limits                                         |
| ---------------------------------- | ---------------------------------------------------- | --------------------------------------------------------- | ---------------------------------------------- |
| `sd_bastille` La Bastille Roulette | La Bastille, Saint Denis, the upstairs parlour       | the round sofa, the flower arrangement and the book on it | min $1, inside $100, outside $500, table $1000 |
| `val_saloon` Valentine Roulette    | Valentine saloon, the front left corner by the piano | a small table and its three chairs                        | the defaults of `Config.Limits`                |

The props come back when you walk away. Because interiors can reload their props, the client checks again every 5 seconds.

## Your own tables in config

`config/tables.lua` holds one entry per table:

| Field               | Meaning                                                                                             |
| ------------------- | --------------------------------------------------------------------------------------------------- |
| `id`                | a unique text id (it is also the key of the table's saved history)                                  |
| `label`             | the name shown in the HUD                                                                           |
| `coords`, `heading` | the table origin on the floor (`vector3`) and its heading; the croupiers sit on the table's +Y side |
| `croupier`          | the dealer ped model, for example `S_M_M_SDDEALER_01` or `S_M_M_VALDEALER_01`                       |
| `chips`             | the chip model, `p_chips_<town>01x` (for example `p_chips_val01x`)                                  |
| `limits`            | optional: any of `minBet`, `maxInside`, `maxOutside`, `maxTotal` in dollars                         |
| `blip`              | `false` hides the map blip                                                                          |
| `hide`              | map props to hide while the table is loaded: `model`, `x`, `y`, `z` (matched within 0.25 m)         |

The Valentine table as it ships:

```lua
{
    id = 'val_saloon',
    label = 'Valentine Roulette',
    coords = vector3(-311.366, 801.701, 117.980),
    heading = 100.04,
    croupier = 'S_M_M_VALDEALER_01',
    chips = 'p_chips_val01x',
    hide = {
        { model = 'p_table06x', x = -311.259, y = 801.043, z = 117.980 },
        { model = 'p_windsorchair03x', x = -312.087, y = 800.875, z = 117.985 },
        { model = 'p_windsorchair03x', x = -311.378, y = 801.870, z = 117.985 },
        { model = 'p_windsorchair03x', x = -310.464, y = 801.164, z = 117.984 },
    },
},
```

To find a spot for a new table, stand where the players' side should be and use `/roulette_addtable` (below). The table needs about 4 x 3.2 m of free floor for the table, the two croupiers and the six places.

## Tables added in game

An admin stands where the players' side should be and types `/roulette_addtable [label]`. The table appears 1.5 m in front of him, facing him, and is saved in the resource's storage. `/roulette_removetable <tableId>` removes it again (only when nobody sits at it and no chips are on it). Tables from `config/tables.lua` are removed there, not by command.

## Custom maps (MLOs)

If a map places Rockstar's `p_roulettetable01x` within `Config.MapScanRadius` (2.5 m) of a configured table, the client uses that exact position a few seconds after you arrive. So a casino MLO with its own roulette table only needs a config entry near it.

## The models

The wheel of Rockstar's table model is part of the table and cannot turn. So `cas-roulette-assets` streams two copies built from the game's own files: `cas_roulette_table` (the table without the spinning centre and its 38 pocket cups; the wooden bowl and the ball track stay) and `cas_roulette_wheel` (the spinning centre with the pocket cups, so the pockets turn with the frets). The wheel is drawn as far as the table (62 m).
