Koja Scripts

Installation

Install Koja Spawn Selector: dependencies, server.cfg order, ESX and QBCore setup, admin command 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)
oxmysqlYesLast location and remembered choice
A frameworkYesESX (es_extended), QBCore (qb-core) or QBox (qbx_core)
Koja MulticharacterNoOpens this map after character selection
qb-apartments, qb-housesNoStarter apartments and owned houses on QBCore

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 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 koja_spawnselector table is created on start. You can also import sql/koja_spawnselector.sql yourself.

Admin command

/spawnselector [id] opens the selector for you or for player id, with ESC enabled so you can close it. It needs the ACE in Config.Admin.Ace (default command) or a framework group from Config.Admin.Groups. From the server console: spawnselector <id>.

Check that it works

  1. Join and load a character. The map opens over the world with your last location selected.
  2. Click another location in the list — the camera flies there.
  3. Press Enter or Spawn here. The camera drops from the sky to your character.
  4. As an admin, type /spawnselector to open it again at any time.

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