Koja Scripts

Installation

Install Koja Spawn Selector: dependencies, server.cfg order, ESX and QBCore setup, admin commands and how to check it works.

Installation

This page takes you from the downloaded archive to a working spawn screen.

Requirements

ResourceRequiredWhat it is used for
koja-libYesFramework bridge (jobs, identifiers, admin check, notifications, vehicle keys and fuel)
oxmysqlYesLast location, locks, editor locations, photos and stats
A frameworkYesESX (es_extended), QBCore (qb-core) or QBox (qbx_core)
screenshot-basicNoLocation photos in the editor
Koja MulticharacterNoOpens this map after character selection
qb-apartmentsNoStarter apartments on QBCore
A housing scriptNoqb-houses, qs-housing, ps-housing, esx_property, nolag_properties or bcs_housing — owned properties become spawns

Install

  1. Put the resource in resources

    Unpack the archive and keep the folder name koja-spawnselector. Other scripts call exports['koja-spawnselector'] and include @koja-spawnselector/import.lua, so the name matters.
  2. Remove the old spawn screen

    • QBCore / QBox with qb-multicharacter: remove qb-spawn. Koja Spawn Selector provides it and handles the same qb-spawn:client:setupSpawns / qb-spawn:client:openUI events, including the qb-apartments starter apartments.
    • ESX: nothing to remove. The selector opens on esx:playerLoaded after your multicharacter loaded the character.
    • Koja Multicharacter: nothing to remove. When it runs, it opens the selector itself and the automatic openers above stay off.
  3. Add it to server.cfg

    server.cfg
    ensure oxmysql
    ensure koja-lib
    ensure screenshot-basic
    ensure koja-spawnselector
    # scripts that use it (multicharacter, housing...) after this line
  4. Pick the language

    shared/config.lua
    Config.Locale = 'en'
    Any file name from shared/locales/ works. See Translations.
  5. Restart the server

    The tables are created on start (see Database).

Admin commands

CommandWhat it does
/spawnselector [id]Opens the selector for you or for player id, with ESC enabled. From the server console: spawnselector <id>
/spawneditorOpens the selector with the Editor and Stats tabs
/spawnevent <minutes> <name>Creates a temporary event where you stand

They need the ACE in Config.Admin.Ace (default command) or a framework group from Config.Admin.Groups.

Check that it works

  1. Join and load a character. The map opens over the world with your last location selected, showing the game time and weather.
  2. Click another location in the list — the camera flies there, the card shows it live and the route from your last location appears.
  3. Press Enter or Spawn here. The camera drops from the sky to your character.
  4. As an admin, type /spawneditor, add a location with Use my position and take a photo.

Changing the UI

The UI is shipped prebuilt in web/dist. You only need Node and pnpm when you change web/src:

cd web
pnpm install
pnpm build

Next steps