> 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-weapon-studio/configuration.md).

# Configuration

Every CAS Weapon Studio setting in config.lua with its default. Staff access, commands, gunsmith towns, counters, the showcase, draw distance, kill notches, custom weapons, jobs and restart times.

All settings are in `cas-weaponstudio/config.lua`. The file stays readable in the escrow build.

{% hint style="warning" %}
A change in `config.lua` needs a restart to take effect. Restart the server, not only this resource, when players are online and a skin was exported since the last start.
{% endhint %}

## All keys

| Key                        | Default                                                                                   | What it does                                                                                                            |
| -------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `Config.AdminGroups`       | `{ "admin", "superadmin" }`                                                               | Framework groups that may open the studio. The ACE `cas.weaponstudio` always works                                      |
| `Config.Command`           | `"weaponstudio"`                                                                          | The command that opens the studio for staff                                                                             |
| `Config.BookCommand`       | `"weaponskins"`                                                                           | The command that opens the skin book for players. `""` turns the command off: then only `Config.Counters` open the book |
| `Config.Debug`             | `false`                                                                                   | Debug prints and the test commands. Keep it `false` on a live server                                                    |
| `Config.Locale`            | `"en"`                                                                                    | The language of every text players and staff see                                                                        |
| `Config.Towns`             | The game's five gunsmiths                                                                 | The gunsmith towns skins and custom guns are sold in                                                                    |
| `Config.TownRange`         | `25.0`                                                                                    | How close (metres) a player must be to a town's gunsmith                                                                |
| `Config.Counters`          | `{}` (none)                                                                               | Optional spots where a prompt opens the book                                                                            |
| `Config.CounterDistance`   | `1.6`                                                                                     | How close (metres) a player must stand to a counter to see its prompt                                                   |
| `Config.CounterKey`        | `0xC7B5340A` (Enter)                                                                      | The control of the counter prompt. The player holds it                                                                  |
| `Config.CounterBlip`       | `"blip_shop_gunsmith"`                                                                    | The map blip of each counter                                                                                            |
| `Config.ApplyAnywhere`     | `true`                                                                                    | Whether players may put skins on and take them off away from a gunsmith                                                 |
| `Config.Showcase`          | `true`                                                                                    | The book holds the weapon in the player's hand up in front of a camera                                                  |
| `Config.DrawDistance`      | `30.0`                                                                                    | Skins are drawn on the weapons of players within this distance (metres)                                                 |
| `Config.MaxSkinnedWeapons` | `24`                                                                                      | The most weapons that carry a skin on one player's screen at once                                                       |
| `Config.Notches`           | `{ enabled = true, players = true, npcs = false, max = 30 }`                              | Kill notches                                                                                                            |
| `Config.Editions`          | `{ enabled = true, minDamage = 0.75, maxDamage = 1.25 }`                                  | Custom weapons                                                                                                          |
| `Config.Weapons`           | `{}` (all weapons on)                                                                     | Turn skins off for single weapons                                                                                       |
| `Config.Jobs`              | `{ "sheriff", "marshal", "deputy", "doctor", "ranger", "rancher", "trader", "gunsmith" }` | The jobs the hand-out offers under "A job"                                                                              |
| `Config.RestartTimes`      | `{ "06:00", "18:00" }`                                                                    | When your server restarts. Only shown in the studio                                                                     |

## Staff access and commands

```lua
Config.AdminGroups = { "admin", "superadmin" }
Config.Command = "weaponstudio"
Config.BookCommand = "weaponskins"
Config.Debug = false
```

* `Config.AdminGroups` works on VORP and RSG. On a standalone server only the ACE works. See [Installation](/script-documentation/cas-weapon-studio/installation.md#who-may-open-the-studio).
* `Config.Debug = true` adds debug prints and the test commands listed in [Commands](/script-documentation/cas-weapon-studio/commands.md).

## Language

```lua
Config.Locale = "en"
```

Shipped: `en`, `tr`, `de`, `fr`, `es`, `pt-BR`, `ru`, `pl`. See [Languages](/script-documentation/cas-weapon-studio/languages.md).

## Gunsmith towns

```lua
Config.Towns = {
    { id = "valentine",  label = "Valentine",   coords = vector3(-281.37, 780.73, 119.53) },
    { id = "rhodes",     label = "Rhodes",      coords = vector3(1322.87, -1323.21, 77.89) },
    { id = "saintdenis", label = "Saint Denis", coords = vector3(2716.42, -1285.42, 49.63) },
    { id = "annesburg",  label = "Annesburg",   coords = vector3(2946.50, 1319.53, 44.82) },
    { id = "tumbleweed", label = "Tumbleweed",  coords = vector3(-5508.11, -2964.24, -0.63) },
}
Config.TownRange = 25.0
```

* `id` is what the script stores with a hand-out. `label` is what staff and players read. `coords` is that town's gunsmith.
* The studio's hand-out and the custom gun form list these towns.
* The book sells the skins and custom guns of the town whose gunsmith is within `Config.TownRange` metres of the player. With more than one in range, the nearest wins.
* The server checks the distance again when a player buys. That check needs the player's position on the server (OneSync). Without it the check is skipped.

{% hint style="info" %}
A hand-out stores town ids. If you change an `id` later, open the skin's hand-out and pick the town again.
{% endhint %}

## Counters

```lua
Config.Counters = {
    -- { town = "valentine", coords = vector3(-281.37, 780.73, 119.53) },
}
Config.CounterDistance = 1.6
Config.CounterKey = 0xC7B5340A -- ENTER
Config.CounterBlip = "blip_shop_gunsmith"
```

Counters are optional. Each one shows a "Skin book" prompt at its spot (hold the key) and a map blip named "Weapon skins". The prompt opens the book of the town named in `town`, which must be a `Config.Towns` id.

Empty by default: players use `Config.BookCommand` at a gunsmith.

Keep a counter away from other scripts' prompts. Only one prompt group shows at a time.

## Putting skins on away from a gunsmith

```lua
Config.ApplyAnywhere = true
```

* `true`: the book opens anywhere. Away from a gunsmith it shows only "My skins", to put skins on or take them off.
* `false`: the book only opens within `Config.TownRange` of a gunsmith town (or at a counter). Elsewhere the player reads "Skins are sold at gunsmiths."

## The showcase

```lua
Config.Showcase = true
```

* `true`: while the book is open, the player raises the weapon in their hand and a camera circles it. The book sits at the side of the screen.
* `false`: no camera and no raised weapon. The book opens in the middle of the screen.

The showcase only starts when the player holds a weapon of the studio and is not on a mount or in a vehicle. See [The skin book](/script-documentation/cas-weapon-studio/skin-book.md).

## Drawing skins

```lua
Config.DrawDistance = 30.0
Config.MaxSkinnedWeapons = 24
```

A skin is a handful of small props on a weapon (6 to 14, by weapon). Every player's game draws the skins of the players around it.

* `Config.DrawDistance`: only weapons of players within this distance get their skin. Keep it short: past 30 m nobody can make a skin out.
* `Config.MaxSkinnedWeapons`: the cap for one screen. The nearest weapons come first.

## Kill notches

```lua
Config.Notches = { enabled = true, players = true, npcs = false, max = 30 }
```

| Field     | Default | What it does                                                             |
| --------- | ------- | ------------------------------------------------------------------------ |
| `enabled` | `true`  | Turns kill notches on or off                                             |
| `players` | `true`  | Kills of other players count                                             |
| `npcs`    | `false` | Kills of townsfolk and outlaws count too                                 |
| `max`     | `30`    | The most marks on one weapon model. The server keeps it between 1 and 30 |

See [Kill notches](/script-documentation/cas-weapon-studio/kill-notches.md).

## Custom weapons

```lua
Config.Editions = { enabled = true, minDamage = 0.75, maxDamage = 1.25 }
```

| Field       | Default | What it does                                                                                                                        |
| ----------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `enabled`   | `true`  | Turns custom weapons on or off. Off: the studio's Custom tab is hidden, the book lists no custom guns and no damage tune is applied |
| `minDamage` | `0.75`  | The lowest damage tune staff may set (1.0 = the game's own). The server keeps it between 0.1 and 1.0                                |
| `maxDamage` | `1.25`  | The highest damage tune staff may set. The server keeps it between 1.0 and 3.0                                                      |

See [Custom weapons](/script-documentation/cas-weapon-studio/custom-weapons.md).

## Single weapons

```lua
Config.Weapons = {
    -- cattleman = { enabled = true },
}
```

`enabled = false` stops the game from drawing skins and kill notches on that weapon. The key is the studio's weapon key (`cattleman`, `schofield`, `winchester` and so on). The full list is in [Designing skins](/script-documentation/cas-weapon-studio/designing.md#the-weapons).

The weapon stays in the studio's Weapons tab and its skins stay in the book. Only the drawing on players' weapons is turned off.

## Jobs

```lua
Config.Jobs = { "sheriff", "marshal", "deputy", "doctor", "ranger", "rancher", "trader", "gunsmith" }
```

The jobs the Export window offers under "A job". Write the names as your framework stores them.

## Restart times

```lua
Config.RestartTimes = { "06:00", "18:00" }
```

Times are server local time, `HH:MM` in 24 hours. The studio shows them as "Next restart 06:00, in 2 h 10 min". The script never restarts the server.

`set ws_restart_times "06:00,18:00"` in `server.cfg` replaces this list. With no valid time the studio shows "No restart time set".

## AI Design

AI Design has no key in `config.lua`. Set it in `server.cfg`:

```cfg
# fal, google or openai
set ws_ai_provider "fal"
set ws_ai_key "YOUR_KEY"
# optional: a model other than the default
# set ws_ai_model ""
```

| Provider | Default model                 |
| -------- | ----------------------------- |
| `fal`    | `fal-ai/nano-banana-pro/edit` |
| `google` | `gemini-2.5-flash-image`      |
| `openai` | `gpt-image-1`                 |

The Clothing Studio's `cs_ai_provider`, `cs_ai_key` and `cs_ai_model` are used when the `ws_ai_*` ones are not set.
