# Spawn Selector V2

## SpawnV2 – Documentation

Welcome to the official documentation for **SpawnV2** – an advanced spawn selector for your RedM server.

***

### 📦 Features

* Beautiful spawn selection UI with background images and location descriptions
* Fully customizable spawn locations (Valentine, Strawberry, Rhodes, and more!)
* Debug mode for easy testing
* Works out of the box with **VORPcore**

***

### ⚡ Quick Start

#### 1. Download & Install

* Download the script from your dashboard or marketplace.
* Place the `spawnv2` folder into your server’s `resources` directory.

#### 2. Add to `server.cfg`

Add the following line to your `server.cfg` (preferably after VORPcore and its dependencies):

```
ensure cas-spawnv2
```

#### 3. Restart Your Server

Either restart your server or type the following command in your server console:

```
ensure cas-spawnv2
```

***

### ⚙️ Configuration

The configuration file is located at:

```
resources/cas-spawnv2/client_config.lua
```

Below is a sample config with explanations for each setting:

```lua
Config = {}

Config.debug = true             -- Set to true to enable debug features
Config.debugCommand = "spawn"   -- Command to open the spawn screen in debug mode
Config.onlyOnFirstLogin = false -- If true, the spawn screen will only show on first login

Config.locations = {            -- Define the locations available for spawning
    test = {
        backgroundImage = "valentinebg",    -- Background image key (used in the UI)
        coords = { x = -3741.52, y = -2620.52, z = -5.06, h = 90.0 },  -- Spawn coordinates and heading
        locationText = "test.",             -- Description text shown on the spawn screen
        locationLogo = "valentinelogo"      -- Logo image key (used in the UI)
    },
    valentine = {
        backgroundImage = "valentinebg",
        coords = { x = -240.6824, y = 740.66033, z = 115.8728, h = 90.0 },
        locationText =
        "A raucous, rough-and-tumble town in the Heartlands, Valentine’s livestock auctions attract traders, ranchers, cowboys, gamblers, outlaws and prostitutes from far and wide, all looking to make some money, raise some hell, and have a good time.",
        locationLogo = "valentinelogo"
    },
    strawberry = {
        backgroundImage = "strawberrybg",
        coords = { x = -1789.656, y = -368.7941, z = 160.47836, h = 45.0 },
        locationText =
        "Strawberry was little more than a small logging town until the arrival of its new mayor, an East Coast eccentric, who is obsessed with transforming it into a cultural beacon for wealthy tourists, much to the bemusement of the locals.",
        locationLogo = "strawberrylogo"
    },
    lagras = {
        backgroundImage = "lagrasbg",
        coords = { x = 2123.95, y = -551.63, z = 41.53, h = 46.69 },
        locationText =
        "A small, remote settlement out in the swamps of Bayou Nwa, Lemoyne, the people of Lagras live self-sufficiently for the most part, making a little money here and there from fishing and acting as guides for travelers wishing to navigate the region.",
        locationLogo = "lagraslogo"
    },
    rhodes = {
        backgroundImage = "rhodesbg",
        coords = { x = 1220.116, y = -1276.558, z = 76.566673, h = 180.0 },
        locationText =
        "Prim and proper on the surface, tensions and corruption run deep in the Southern town of Rhodes, which for years has been caught in the crossfire between the Braithwaites and the Grays, two warring plantation families.",
        locationLogo = "rhodeslogo"
    },
    mounthagen = {
        backgroundImage = "mounthagenbg",
        coords = { x = -1889.234, y = 1316.0382, z = 199.36845, h = 270.0 },
        locationText =
        "One of the more well-known peaks in the snowy Grizzlies of Ambarino, Mount Hagen towers above Lake Isabella to the west and Beartooth Beck to the east, which provides the main pass through the western mountain range and joins up with the Dakota River further south.",
        locationLogo = "mounthagenlogo"
    }
}
```

**Options Explained**

* **Config.debug**\
  Set to `true` to enable debug features (useful for development and testing).
* **Config.debugCommand**\
  The command you type in chat to open the spawn selector in debug mode (default: `/spawn`).
* **Config.onlyOnFirstLogin**\
  If set to `true`, the spawn screen will only appear the first time a player joins.
* **Config.locations**\
  Define as many spawn locations as you want. Each location must include:
  * `backgroundImage`: Background image key for the spawn UI
  * `coords`: `{ x, y, z, h }` – spawn coordinates and heading
  * `locationText`: Description for the spawn location
  * `locationLogo`: Logo key for the spawn UI

***

### 💡 Notes

* **Dependencies:**\
  Works **only with VORPcore** at the moment.
* **Customization:**\
  You can add/remove locations or update descriptions, images, and coordinates freely in the config.

***

### 🖥️ Live Demo

Want to see it in action?\
👉 [Try the demo on www.codeaftersex.com](https://www.codeaftersex.com)

***

### 💬 Need Help?

For support, join our Discord server or check the documentation for common issues and troubleshooting.

***

> _Thank you for using SpawnV2! If you enjoy this script, please consider leaving feedback or a review._
