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

# Kill notches

Kill notches in CAS Weapon Studio for RedM. Kills with a weapon in hand cut tally marks into its grip or stock, up to 30, seen by everyone. How kills count, where they show and how players smooth them

A kill with a weapon in the hand cuts a tally mark into its grip or stock. The marks add up to 30 and everyone sees them.

{% hint style="warning" %}
Kill notches are code only, not verified in game yet. Test them on your own server before you rely on them.
{% endhint %}

## How a kill counts

1. A player kills a person with a weapon of the studio in their hand. The notches show on the firearms; knives, hatchets, throwing weapons and bows count their kills too but show no notches yet.
2. The killer's game reports the kill to the server.
3. The server adds one to the count of that character and that weapon model.
4. The new count shows on the weapon for everyone nearby.

| Rule                  | Detail                                                       |
| --------------------- | ------------------------------------------------------------ |
| Who counts            | People only. Animals never count                             |
| Other players         | Count when `Config.Notches.players` is `true` (the default)  |
| Townsfolk and outlaws | Count when `Config.Notches.npcs` is `true` (default `false`) |
| Which weapon          | The weapon in the killer's hand                              |
| How fast              | At most one notch every 1.5 seconds for one player           |
| The most              | `Config.Notches.max`, 30 at most                             |

The count belongs to the character and the weapon model, not to one single gun. A character with two Cattleman revolvers has one count for both.

## Where the notches show

* On both sides of the grip or stock.
* On short arms and long arms alike, each with its own size of mark.
* With or without a skin: a weapon needs no skin to carry notches.
* For every player within `Config.DrawDistance` metres, like a skin.

A weapon turned off in `Config.Weapons` shows no notches.

## Smoothing them off

Players remove their notches in the skin book.

1. Open the book with `/weaponskins`.
2. Go to "My skins". The "Notches" group lists each weapon with its count: "Notches: 7".
3. Press "Smooth them off", then "Sure?".
4. The player reads "The notches on your are smoothed off." The count of that weapon model is back to zero.

This works anywhere the book opens. It costs nothing.

## Settings

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

| Field     | Default | What it does                                                                                        |
| --------- | ------- | --------------------------------------------------------------------------------------------------- |
| `enabled` | `true`  | `false` turns notches off: no kill is counted, nothing is shown and the book has no "Notches" group |
| `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                            |

Counts are stored in the `cas_weaponskin_kills` table, one row per character and weapon model. Turning notches off keeps the rows.

## Not the same as the emblem

The studio has an emblem called "Tally Notches". That is a drawing staff put into a skin. It never changes. Kill notches are added by the game, kill by kill.

## Testing

With `Config.Debug = true`, `/ws_test notch <count>` shows that many notches on the weapon in your hand, on your screen only. `/ws_test off` takes them off. See [Commands](/script-documentation/cas-weapon-studio/commands.md).
