# Configuration

> Everything you can change lives in one file — config/config.lua.

Open **`config/config.lua`** in the `nobit_pool` folder with any text editor. Every setting is explained inside it as well. After changing anything, restart the resource: `restart nobit_pool`.

## Tables

```lua
mapTables = true,
tables = {
    -- vec4(x, y, z, heading),
},
```

With `mapTables = true`, every pool table already on the map becomes playable, including those inside MLOs. `tables` adds your own — see [Adding tables](/docs/pool/tables).

## Distances

```lua
spawnDistance  = 100.0,
watchDistance  = 10.0,
promptDistance = 2.5,
leaveDistance  = 5.0,
```

All in metres.

| Setting          | What it does                                                                                                        |
| ---------------- | ------------------------------------------------------------------------------------------------------------------- |
| `spawnDistance`  | Table props you added exist within this distance of a player.                                                       |
| `watchDistance`  | Players this close to a table see the balls and every shot.                                                         |
| `promptDistance` | The table menu opens this close to the table.                                                                       |
| `leaveDistance`  | A player who gets further than this from their table — walks off, is teleported, switches character — leaves the match, and the opponent wins by forfeit. |

## Shot clock and practice

```lua
shotClock = 30,
practice  = true,
```

`shotClock` is the seconds a player has to shoot. Running out is a foul and the opponent gets ball in hand. `0` turns the clock off. The clock waits while balls are still moving, and there is no clock in practice.

`practice = false` removes **Practice** from the table menu.

## Aiming feel

```lua
aimSensitivity   = 20.0,
fineAimFactor    = 0.1,
powerSensitivity = 0.5,
invertPower      = false,
```

| Setting            | What it does                                                         |
| ------------------ | -------------------------------------------------------------------- |
| `aimSensitivity`   | How fast the cue turns with the mouse                                |
| `fineAimFactor`    | Aim speed while fine aim is held: `0.1` is a tenth of normal         |
| `powerSensitivity` | How much power each bit of pull-back adds                            |
| `invertPower`      | `true` makes pushing the mouse forward add power instead of pulling back |

## Sound

```lua
volume = 0.8,
```

Volume of the table sounds, `0` to `1`. They are made live in the browser, so they do **not** follow GTA's own volume slider.

## Keys

```lua
keys = {
    newGame     = 38,   -- E, table menu
    practice    = 47,   -- G, table menu
    power       = 24,   -- left mouse: hold and pull back, release to shoot
    place       = 24,   -- left mouse: put the cue ball down
    spin        = 25,   -- right mouse: hold and move the mouse to pick where the cue hits
    fineAim     = 21,   -- left shift
    callPocket  = 44,   -- Q: change the pocket for the 8
    guideline   = 47,   -- G: practice only
    moveCueBall = 38,   -- E: practice only
    rerack      = 45,   -- R: practice only
    leave       = 194,  -- backspace
},
```

These are GTA **control ids**, not key names. Find the id for any key in the [FiveM controls list](https://docs.fivem.net/docs/game-references/controls/). The on-screen hints update to whatever you set.

## Language

```lua
locale = 'en',
```

The name of a file in `config/locales`, without `.json`. See [Translating](/docs/pool/translation).
