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

# Installation

Install CAS Housing on a RedM server with VORP, RSG or standalone. Requirements, server.cfg lines, staff access and the first start.

## Requirements

* A RedM server with **oxmysql**.
* One of:
  * **VORP**: vorp\_core, and vorp\_inventory (or CAS Advanced Inventory) for storage.
  * **RSG**: rsg-core, and rsg-inventory for storage.
  * **No framework** (standalone): everything is free and storage is off.
* OneSync is recommended. With it the server checks where players stand; without it those checks stand aside.
* Optional: **CAS Stables** (`cas-stables`). A hitching post placed at a home then brings the player's own horse out, and a wagon spot their wagon. Without it those two pieces are left out of build mode.

## Steps

1. Copy the `cas-housing` folder into your resources.
2. In `server.cfg`, after oxmysql, your framework and your inventory:

   ```
   ensure cas-housing
   add_ace group.admin cas.housing allow
   ```

   The ACE `cas.housing` opens the property creator. The framework groups in `Config.AdminGroups` (`admin`, `superadmin`) work too.
3. Start the server. The five tables (`cas_housing_properties`, `cas_housing_keys`, `cas_housing_furniture`, `cas_housing_stored`, `cas_housing_spawn`) are created by themselves. The console says something like:

   ```
   [cas-housing] framework: vorp
   [cas-housing] ready: 52 properties, 0 placed pieces, 592 catalogue items, 1707 doors known, storage vorp
   ```
4. The home pack is installed on the first start: 52 homes are for sale at once. See [The home pack](/script-documentation/cas-housing/home-pack.md).
5. In game, as staff, type `/housingadmin` to open the property creator.

{% hint style="info" %}
The resource never touches your spawn flow. If you want players to wake up in their home's bed, see [For developers](/script-documentation/cas-housing/developers.md#spawning-at-home).
{% endhint %}

## The wardrobe

Wardrobe furniture (an armoire or a vanity) fires one client event of your clothing script: the first entry of `Config.Wardrobe` whose resource is running. CAS Character Creator, vorp\_character, rsg-wardrobe and rsg-appearance are listed already. Put your own clothing script's event first if you use another one.

## Building the NUI from source (Open Source build)

The Open Source build includes the interface source in `web/`:

```
cd web
npm install
NODE_ENV=production npm run build
```

This writes `html/`. Set `NODE_ENV=production`: a shell left on `development` builds React's development bundle.
