> 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-gunsmith/support/troubleshooting.md).

# Troubleshooting

Fix common CAS Gunsmith issues — what each notification means and the most frequent setup problems, from the prompt not appearing to lost presets.

When looking into a problem, first set `Config.Debug = true` in `config.lua`. Detailed logs are written to the F8 console and the server console with the `[rsm_gunsmith]` prefix. `/gstp` then takes you straight to a gunsmith (`/gstp rhodes`, `/gstp 2`). Set it back to `false` when you are done, since every player can use these tools while it is on.

## Notifications

| Notification                                                    | Cause and fix                                                                                                                                                                                                                                                                      |
| --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| You need to stand at the gunsmith bench.                        | The player is further than `ServerDistance` from the shop coordinates. Move the shop's `coords` to the front of the bench.                                                                                                                                                         |
| You carry nothing the gunsmith can work on.                     | The inventory has no weapon defined in `Config.Weapons`, or the item name does not match `hash`.                                                                                                                                                                                   |
| The gunsmith cannot see your weapons right now.                 | The inventory did not respond. Check that `vorp_inventory` or `rsg-inventory` is running and started before this resource.                                                                                                                                                         |
| The price changed. Check the order and try again.               | Prices or configuration changed while the bench was open. Close the bench and open it again.                                                                                                                                                                                       |
| Not enough cash for this order.                                 | The player's cash does not cover the total.                                                                                                                                                                                                                                        |
| You have no Gun Oil left.                                       | The inventory has no item named `Config.GunOilItem`.                                                                                                                                                                                                                               |
| The gunsmith could not fit the new parts. You were not charged. | The inventory could not save the components. On VORP, check that your `vorp_inventory` version includes the weapon component exports. On RSG, check that the weapon item still has its `info.serie`.                                                                               |
| Some ammunition did not fit in your satchel and was refunded.   | The inventory did not accept the ammo. Match the `Config.AmmoCap` values to your inventory's ammo limits. On RSG, the box item in `Config.Rsg.ammoBoxes` must exist in `rsg-core/shared/items.lua` (the default list has no `ammo_box_varmint`) and the satchel needs room for it. |

The texts above are the English ones. With another `Config.Locale` the same notifications come from that language file; the key is shown in [Localization](/script-documentation/cas-gunsmith/configuration/localization.md).

## Common cases

**The prompt does not appear.** The shop's `coords` are far from the bench, or `InteractDistance` is too small. The prompt does not appear while mounted.

**The bench opens but the interface is not visible.** The `web/dist` folder is missing. Upload the folder again, or build it as shown in [Editing the UI](/script-documentation/cas-gunsmith/developer/editing-the-ui.md).

**Texts show as keys, such as `msg.noWeapons`.** The key is missing from both the chosen language file and `en.json`, usually because `en.json` was edited. Put the key back into `en.json`.

**The language does not change.** Check the server console for `locales/<name>.json not found or not valid JSON`. A missing comma or quote makes the whole file invalid; check it with a JSON validator. After changing `fxmanifest.lua` or adding a language file, run `refresh` before restarting the resource.

**The weapon faces the wrong way.** Set `Config.Bench.yawOffset = 180.0`.

**Focusing on a part moves the camera to the stock.** Set `Config.Bench.muzzleSign = -1`.

**The weapon does not fit the frame or looks too small.** Adjust the sizes for that class or model in `Config.Bench.span`. See [Display Camera](/script-documentation/cas-gunsmith/configuration/display-camera.md).

**A finish shows a different colour in game.** Change the `index` value of that finish in `Config.Metals`.

**Maintenance was done but the weapon still looks dirty.** If the weapon is in the satchel, maintenance is applied the next time it is equipped.

**Presets and weapon records are gone.** If the resource folder was renamed, the data stays tied to the old name. Give the folder its old name back.

**The error line does not match the code in the file.** The server is running an old file. Restart the resource and try again.
