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

# Configuration

Every setting of CAS Housing's config.lua explained. Limits, rent, tax, keys and roles, knocking, viewing, warrants, the home pack, prompts, storage, wardrobe and build mode.

Everything is in `config.lua`, and every line is commented. Homes themselves are made in game, so this file only holds the rules they follow.

## General

| Setting              | Default                                     | What it does                                                                                         |
| -------------------- | ------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| `Config.Locale`      | `"en"`                                      | The language. See [Languages](/script-documentation/cas-housing/languages.md).                       |
| `Config.Debug`       | `false`                                     | Debug prints and test commands. Keep it off on a live server.                                        |
| `Config.AdminGroups` | `{ "admin", "superadmin" }`                 | Framework groups that may open the creator. The ACE `cas.housing` always works.                      |
| `Config.Commands`    | `{ Admin = "housingadmin", Home = "home" }` | Command names. Set `Home` to `""` to turn `/home` off (the prompt at the door still opens the menu). |
| `Config.Currency`    | `{ Vorp = 0, Rsg = "cash" }`                | The money that pays for homes and furniture. Standalone: everything is free.                         |
| `Config.MoneySign`   | `"$"`                                       | The sign shown before prices.                                                                        |

## Owning

| Setting            | Default                                                                                       | What it does                                                                                                   |
| ------------------ | --------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| `Config.MaxHomes`  | `1`                                                                                           | How many properties one character may hold, bought or rented.                                                  |
| `Config.SellShare` | `0.6`                                                                                         | Selling a bought home back to the bank pays this share of its price. A rented home pays nothing.               |
| `Config.Transfer`  | `{ Rented = false, Fee = 0 }`                                                                 | Handing a home to a player next to you. `Rented`: may a rented home be handed over. `Fee`: the paperwork cost. |
| `Config.Sale`      | `{ Enabled = true, OfferSeconds = 60 }`                                                       | Selling a home to a player for a price. `OfferSeconds`: how long the buyer has to answer.                      |
| `Config.Keys`      | `{ Max = 8, AnyOnline = true, DefaultRole = "roommate" }`                                     | Key holders per home. `AnyOnline`: pick any player in the game (false: only players standing near).            |
| `Config.KeyRoles`  | see below                                                                                     | What a co-owner, a roommate and a guest may do.                                                                |
| `Config.Knock`     | `{ Enabled = true, Cooldown = 10, AnswerSeconds = 30, OpenSeconds = 60, NotifyAway = false }` | Knocking at the door. See [Your home](/script-documentation/cas-housing/your-home.md#knocking).                |
| `Config.Rent`      | `{ PeriodDays = 7, MissedLimit = 2, StoredDays = 14, MaxAheadPeriods = 4 }`                   | Weekly rent. See [Buying and renting](/script-documentation/cas-housing/buying-and-renting.md#rent).           |
| `Config.Tax`       | `{ Enabled = false, Rate = 0.02, PeriodDays = 365, MissedLimit = 2 }`                         | An optional property tax on bought homes.                                                                      |
| `Config.Viewing`   | `{ Enabled = true, Seconds = 180 }`                                                           | "View inside" on the sale card.                                                                                |
| `Config.Warrant`   | `{ Enabled = true, Jobs = { "sheriff", "marshal", "police" }, MinGrade = 0, Seconds = 120 }`  | Lawmen's "Force the door".                                                                                     |
| `Config.Offices`   | empty                                                                                         | Optional real estate offices: a blip and a prompt that list every home for sale.                               |
| `Config.HomePack`  | `{ Enabled = true, AutoInstall = true, PriceScale = 1.0, RentScale = 1.0 }`                   | The 52 ready-made homes. See [The home pack](/script-documentation/cas-housing/home-pack.md).                  |

### Key roles

The owner may always do everything. Only the owner sells the home, hands it over, gives or takes a co-owner's key and changes the role of a key. Every key holder may hand their own key back.

| Permission | Co-owner | Roommate | Guest | What it allows                                    |
| ---------- | -------- | -------- | ----- | ------------------------------------------------- |
| `lock`     | yes      | yes      | yes   | Lock and unlock the doors                         |
| `storage`  | yes      | yes      | no    | Open the home's storage and its storage furniture |
| `wardrobe` | yes      | yes      | no    | Wardrobe furniture and the menu's Wardrobe button |
| `spawn`    | yes      | yes      | no    | Choose this home's bed to wake up in              |
| `build`    | yes      | yes      | no    | Place furniture with their own money              |
| `buildAll` | yes      | no       | no    | Move, sell and store pieces others placed         |
| `keys`     | yes      | no       | no    | Give and take roommate and guest keys             |
| `pay`      | yes      | no       | no    | Pay rent or tax ahead                             |
| `letIn`    | yes      | yes      | no    | Answer a knock at the door                        |
| `stable`   | yes      | yes      | no    | Bring their own horses and wagons out at the home |

Change any of these in `Config.KeyRoles`. A permission left out keeps the default above.

## In the world

| Setting                   | Default                                           | What it does                                                                                                  |
| ------------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| `Config.InteractDistance` | `2.2`                                             | How close to an entrance or a door a prompt shows.                                                            |
| `Config.PieceDistance`    | `1.6`                                             | How close to a piece of furniture its prompt shows.                                                           |
| `Config.NearbyDistance`   | `4.0`                                             | How close another player must stand to get the deed (and a key, with `AnyOnline = false`).                    |
| `Config.PromptKeys`       | G, R, ENTER                                       | The three prompt keys. Never put U and G in one group: the game hides one of them.                            |
| `Config.PromptHoldMs`     | `600`                                             | How long a prompt key is held before it acts.                                                                 |
| `Config.Blips`            | for sale and mine on                              | Blips for homes for sale and for your own homes.                                                              |
| `Config.HomeMenu`         | `{ Storage = false, Wardrobe = false }`           | Storage and the wardrobe open at their furniture. Set these to true to have buttons in the home menu as well. |
| `Config.Wardrobe`         | four clothing scripts                             | The client event wardrobe furniture fires: the first whose resource is running.                               |
| `Config.Stables`          | `{ Enabled = true, Resource = "cas-stables" }`    | The home stable with CAS Stables.                                                                             |
| `Config.Storage`          | `{ AcceptWeapons = true, RsgMaxWeight = 400000 }` | Storage is a custom inventory on VORP and a stash on RSG.                                                     |

## Furniture and build mode

| Setting                                  | Default                           | What it does                                                                                                                                           |
| ---------------------------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Config.LoadDistance` / `UnloadDistance` | `70` / `90`                       | Furniture is drawn within this many metres of a home's edge.                                                                                           |
| `Config.MaxLoadedPieces`                 | `700`                             | The most pieces one game keeps at once, nearest homes first.                                                                                           |
| `Build.PriceMultiplier`                  | `1.0`                             | Every catalogue price times this.                                                                                                                      |
| `Build.SellShare`                        | `0.5`                             | Selling a placed piece pays this share back.                                                                                                           |
| `Build.KeyHoldersBuild`                  | `true`                            | May key holders place furniture at all (roles decide who).                                                                                             |
| `Build.OutdoorInHomes`                   | `false`                           | false: fences, tents and structures stand on plots and in a home's yard only.                                                                          |
| `Build.IndoorInYard`                     | `true`                            | true: porch furniture (chairs, tables, plants, lamps) may stand in a home's yard too.                                                                  |
| `Build.ZoneMargin`                       | `0.25`                            | Metres a piece may stand outside the zone's edge.                                                                                                      |
| `Build.Reach`                            | `30`                              | How far from the property a builder may stand.                                                                                                         |
| `Build.GridSteps` / `AngleSteps`         | 5, 10, 25 cm / 15, 45, 90 degrees | The snaps offered in build mode.                                                                                                                       |
| `Build.Crosshair`                        | `true`                            | true: the piece sits where the crosshair points. false: the panel keeps its cursor and the piece follows the mouse, with exact fields and a nudge pad. |
| `Build.Camera`                           | off                               | An optional free camera that orbits inside the property.                                                                                               |
| `Config.DisabledItems`                   | empty                             | Catalogue models to leave out.                                                                                                                         |
| `Config.Limits`                          | see file                          | What staff may type in the creator: furniture, storage, doors, zone size, price, hidden pieces, yard.                                                  |
| `Config.Defaults`                        | see file                          | What a new home or plot starts with in the creator (price, rent, furniture limit, storage, Empty inside, yard).                                        |
