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

# The skin book

The CAS Weapon Studio skin book for players on RedM. The command, opening it at a gunsmith, the showcase camera, trying a skin on, buying, putting skins on and taking them off, and custom guns.

The skin book is the players' side of the script. In it a player buys skins and custom guns, tries a skin on the weapon in their hand, and puts their skins on or takes them off.

{% hint style="info" %}
One skin per weapon model and character. A skin shows on every weapon of its kind the character carries. Putting another skin on the same weapon model takes the place of the first.
{% endhint %}

## Opening the book

| How                          | What opens                                                                                                                                    |
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `/weaponskins` at a gunsmith | The book of that town: "For sale here" and "My skins"                                                                                         |
| `/weaponskins` anywhere else | The book opens on "My skins". Nothing is on sale away from a gunsmith                                                                         |
| A counter prompt             | The book of the counter's town. Counters are optional, see [Configuration](/script-documentation/cas-weapon-studio/configuration.md#counters) |

* "At a gunsmith" means within `Config.TownRange` metres (default 25) of a gunsmith in `Config.Towns`.
* With `Config.ApplyAnywhere = false` the book does not open away from a gunsmith. The player reads "Skins are sold at gunsmiths."
* The command name is `Config.BookCommand`.
* `Esc` or the cross closes the book.

The book's title is the town's name. Under it: "Skin book" and the character's name.

## At a gunsmith

The book has two tabs.

| Tab           | What it lists                                            |
| ------------- | -------------------------------------------------------- |
| For sale here | The custom guns and the skins this town's gunsmith sells |
| My skins      | The skins the character may use, and their kill notches  |

Skins are grouped by the weapon they are made for. The weapon in the player's hand comes first and is marked IN YOUR HAND.

Only live skins are in the book. A skin that waits for the restart is not listed.

## The showcase camera

With `Config.Showcase = true` (the default) and a weapon of the studio in the player's hand, the book opens as a panel on the left. The character raises the weapon and a camera circles it on the free part of the screen.

| Control                             | What it does                       |
| ----------------------------------- | ---------------------------------- |
| Drag on the free part of the screen | Turns the camera around the weapon |
| Mouse wheel                         | Moves the camera closer or further |

The showcase does not start when the player:

* has no weapon in hand, or a weapon the studio does not know,
* is on a mount or in a vehicle,
* or the server has `Config.Showcase = false`.

Then the book opens in the middle of the screen and says "Take a weapon in your hand to try skins on it." The showcase ends when the weapon leaves the player's hand or the book closes.

## At a CAS Gunsmith bench

When the server also runs [CAS Gunsmith](https://code-after-sex.gitbook.io/script-documentation/cas-gunsmith/), its bench gets a **Skins** tab. Nothing to set up on the Weapon Studio side: start both resources.

| In the Skins tab  | What it does                                                                               |
| ----------------- | ------------------------------------------------------------------------------------------ |
| On sale here      | The skins this town's gunsmith sells for the weapon on the bench                           |
| Your skins        | The character's own skins for that weapon model                                            |
| A click on a skin | Shows it on the bench weapon, on the player's screen only. A second click takes it off     |
| Buy               | Pays in cash at once (not through the gunsmith's work order)                               |
| Put On / Take Off | The same as in the book: the skin goes on every weapon of that model the character carries |

* The bench weapon first wears the skin the character's weapons of that model wear now.
* The tab follows the weapon picked in the bench's weapon rack, long arms included.
* It sells only the skins of the bench's town: CAS Gunsmith's shop ids (`valentine`, `rhodes`, `saintdenis`, `annesburg`, `tumbleweed`) are the same as the default `Config.Towns` ids. Keep them the same if you add towns.
* Server owners turn the tab off in CAS Gunsmith with `Config.WeaponStudio = false`.

## Trying a skin on

A player can see a skin on their own weapon before they pay.

1. Take the weapon in your hand, then open the book.
2. Rows made for that weapon say "Click to try it on". Click one.
3. The skin shows on the weapon at once. The row says TRYING IT ON.
4. Click the row again to take it off, or click another row to try that one.

What to know:

* The try shows on the player's own screen only. Nobody else sees it.
* It works for skins on sale, for the player's own skins and for the skin of a custom gun.
* A row made for another weapon says "Take your in your hand to try it".
* Buying, putting on, taking off, changing the tab and closing the book all end the try. The weapon then shows what it really carries.

## Buying a skin

On "For sale here", each skin shows its picture, its name, the weapon it is for and its price. Press "Buy".

* The player must stand at a gunsmith of a town that sells the skin.
* The price is taken from the character's money (dollars on VORP, cash on RSG, nothing on standalone).
* The player then reads "Bought for $." and the skin is under "My skins".
* A skin the character already has is marked OWNED and cannot be bought twice.

Buying does not put the skin on. That is the next step.

## Putting a skin on and taking it off

"My skins" lists every skin the character may use:

| Where it came from           | Marked as     |
| ---------------------------- | ------------- |
| Bought at a gunsmith         | Nothing extra |
| Free for the character's job | "your job's"  |
| Given by staff               | "a gift"      |
| Came with a custom gun       | Nothing extra |

| Button   | What it does                                                                        |
| -------- | ----------------------------------------------------------------------------------- |
| Put on   | The skin goes on every weapon of that model the character carries. The row shows ON |
| Take off | The weapon goes back to how the game made it                                        |

* The player does not need the weapon in hand to put a skin on. It shows as soon as they carry a weapon of that model.
* A skin stays on after a relog and after a restart. It is stored per character.
* With `Config.ApplyAnywhere = true` (the default) players can do this anywhere. With `false` they must be at a gunsmith: "Go to a gunsmith to do that."

## Who sees the skin

Every player's game draws the skins of the players around it: on the weapon in the hand, in the holster and on the back.

* Skins are drawn within `Config.DrawDistance` metres (default 30).
* At most `Config.MaxSkinnedWeapons` weapons (default 24) carry a skin on one screen, the nearest first.
* A weapon the game hides hides its skin too.

{% hint style="warning" %}
Verified in game for the player's own weapon. Another player seeing the skin is code only, not verified yet: it needs a second client.
{% endhint %}

## Custom guns

When the town's gunsmith sells custom guns, "For sale here" starts with a "Custom guns" group.

Each gun shows its name, its base weapon, its damage tune ("+20 % damage"), how many are left of a limited run ("3 left"), its description and its price.

* "Buy" pays the price and hands over the real weapon.
* The player reads "Bought for $. The weapon is yours."
* The gun's skin comes with it and is put on. When the skin is not live yet, the player also reads "Its skin goes on after the next restart." After that restart the skin is under "My skins" and the player puts it on there.
* A sold out gun shows SOLD OUT. Only players who own one still see it.
* A click on a gun made for the weapon in hand tries its skin on, like any skin.

See [Custom weapons](/script-documentation/cas-weapon-studio/custom-weapons.md) for what the buyer gets on each framework.

## Kill notches

When kill notches are on, "My skins" has a "Notches" group. It lists each weapon with its count and a "Smooth them off" button. See [Kill notches](/script-documentation/cas-weapon-studio/kill-notches.md).

## Messages a player may see

| Message                                         | Meaning                                                                                                 |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| Skins are sold at gunsmiths.                    | The book was opened away from a gunsmith and `Config.ApplyAnywhere` is `false`                          |
| No skins on sale here.                          | This town's gunsmith sells nothing yet                                                                  |
| You own no skins yet.                           | "My skins" is empty                                                                                     |
| This skin is not sold here.                     | The skin is not sold in this town, or it left the book                                                  |
| Go to a gunsmith to do that.                    | The player is too far from the gunsmith                                                                 |
| You already own this skin.                      | It is already under "My skins"                                                                          |
| You do not have enough money.                   | The price is higher than the character's money                                                          |
| This skin is not yours.                         | The skin was deleted, a gift was taken back or the job changed                                          |
| The skin could not be shown on your weapon.     | The try failed. Most often the skin's files are not in this player's game yet: rejoin after the restart |
| Pick your character first.                      | The player has no character selected                                                                    |
| One moment, your last request is still running. | A second click while the first purchase runs. Nothing is paid twice                                     |
