> 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).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://feron-scripts.gitbook.io/welcome/scripts/feron-spawnselector.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
