> For the complete documentation index, see [llms.txt](https://feron-scripts.gitbook.io/welcome/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://feron-scripts.gitbook.io/welcome/scripts/feron-spawnselector.md).

# Feron Spawnselector

Modern spawn-location picker for FiveM. React-based UI with screen blur background, keyboard navigation, and seamless integration with `feron_multicharacter`.

* **Frameworks:** QBCore / Qbox (main package) · ESX Legacy (ESX package)
* **MySQL:** oxmysql (required on ESX for the "Last Location" feature)

## Features

* React UI with screen-blur background and per-location camera preview
* Pre-configured spawn locations + an automatic "Last Location" entry
* Keyboard navigation (`↑` / `↓` to browse, `Enter` to spawn)
* Auto-spawn countdown (configurable, 0 = off)
* Light / dark theme toggle
* Drop-in replacement for `qb-spawn` (declares `provide "qb-spawn"`)
* Pairs natively with `feron_multicharacter` — coordinates HUD restore + loadout wake

## Installation

### 1. Drop the resource

Copy `feron_spawnSelector/` into your `resources/` folder.

### 2. `server.cfg`

```cfg
ensure oxmysql
ensure feron_spawnSelector
```

Load order: `oxmysql` (or your mysql lib) before — your framework core before that.

### 3. Edit `config.lua`

* `Config.SpawnLocations` — the picker entries (label, description, world coords, camera position, icon)
* `Config.AutoSpawnTimeout` — seconds before auto-spawn (`0` to disable)
* `Config.Events` — framework-specific event names triggered after spawn
* `Config.Translate` — strings shown in the UI

Full reference: [Config](/welcome/scripts/feron-spawnselector/config.md).

***

## Multichar integration

When `feron_multicharacter` is installed on the same server, the two resources coordinate automatically — no configuration needed:

* Spawnselector skips its auto-open on `esx:playerLoaded` / QBCore `OnPlayerLoaded`
* `feron_multicharacter` triggers it via `feron_spawnSelector:client:openUI` at the right moment
* After the spawnselector places the player, it fires `feron_spawnSelector:client:spawnFinished` — multichar listens for that to wake HUD scripts + restore loadout

***

## ESX-specific notes

* "Last Location" reads from the `users.position` column (populated by ESX's `Core.SavePlayer` on save / disconnect / `/relog`)
* Requires the `@oxmysql/lib/MySQL.lua` import (already in the shipped `fxmanifest.lua`)

## QBCore / Qbox-specific notes

* "Last Location" reads from `PlayerData.position` via the core API
* `provide "qb-spawn"` means you don't need to disable `qb-spawn` — FiveM resolves it as the same resource name

***

For the full annotated `config.lua`, see [Config](/welcome/scripts/feron-spawnselector/config.md).
