Skip to content

Kivo Spawn Examples

Config.spawnlocations = {
{
id = 'beach',
coords = vector4(-1411.59, -1241.65, 4.40, 12.28),
img = 'images/beach.png',
name = 'Vespucci Beach',
description = 'Relax by the shore.',
temperature = '32C',
wind = 'Light',
weather = 'sunny',
spawnfunction = 'default',
},
{
id = 'legion',
coords = vector4(-269.4, -955.3, 31.2, 205.0),
img = '',
name = 'Legion Square',
description = 'The middle of the city.',
temperature = '28C',
wind = 'Calm',
weather = 'clear',
spawnfunction = 'default',
},
{
id = 'junkyard',
coords = vector4(1086.21, -2328.31, 31.30, 236.89),
img = '',
name = 'Junk Yard',
description = 'Quiet and out of the way.',
temperature = '30C',
wind = 'Light',
weather = 'overcast',
spawnfunction = 'default',
},
-- add two more entries in the same shape
}

The image file images/beach.png must exist in the resource’s html/images/ folder. Locations with img = '' use the default image.

Example: keep a fixed order and no Last Location card

Section titled “Example: keep a fixed order and no Last Location card”
Config.spawnbehavior.allowLastSpawnLocation = false
Config.lastSpawnThread = false

Players always pick from your list. Turning off lastSpawnThread also stops the position recording that feeds the Last Location card.

The hub height is the z value. Raise it for a wider view, lower it for a closer one.

Config.spawnbehavior.hub = {
coords = vector3(-269.0, -955.0, 500.0),
rot = vector3(-90.0, 0.0, 0.0),
}

Each location view uses the same height and rotation as the hub, so one change affects the whole selector.

Config.spawnbehavior.cameraHoverDelay = 300 -- wait longer before the camera follows the mouse

Example: skip the selector for new characters outside the suite

Section titled “Example: skip the selector for new characters outside the suite”

Config.newCharSkipSelector works when another script fires the hand-off event with isNew = true. Kivo Multichar never does, so it has no effect in the suite.

Config.newCharSkipSelector = true
Config.defaultSpawn = vector4(-269.4, -955.3, 31.2, 205.0)
RegisterCommand('respawnmenu', function()
exports['kivo-spawn']:openSpawnUI()
end, false)
Situation What to expect
Kivo Multichar is not started Kivo Spawn opens by itself when your framework reports the character as loaded.
Kivo Multichar is started but Config.spawnSelector is 'default' Kivo Spawn waits for a hand-off that never comes and stays idle.
Kivo Multichar folder renamed No effect. Kivo Spawn finds Multichar by the name Multichar announces when it starts.
New character in the suite Multichar places the character itself. The selector is not shown.
New character from another script, isNew = true, newCharSkipSelector = false The selector opens, without a Last Location card.
Location without coords The entry is ignored.
Two locations with the same id They are not told apart. Give each location its own id.
ESX Keep spawnmanager started. Kivo Spawn switches off its automatic spawn.
QBCore or QBX spawnmanager may stay started. Kivo Spawn switches off its automatic spawn.
No framework detected and no Multichar The selector opens by itself shortly after the resource starts, which is useful for a demo.
  1. A white screen covers the game.

    • Fixed in 1.5.0. Update Kivo Spawn to the current version.
  2. Player stuck on the loading screen.

    • Make sure your loading screen resource shuts down once the player session starts, before the hand-off event fires.
    • Some setups use setr loadscreen:externalShutdown "false" in server.cfg as a workaround.
  3. The player spawns at the wrong place.

    • Use a vector4 with a heading for every location.
    • Check that the selected location is the one you expect. Two locations with the same id clash.
  4. The camera stays stuck after a location is chosen.

    • A custom spawn function returned data without coords. Base it on SpawnFunctions.default as shown on Exports and integration.
  5. The selector never opens.

    • Kivo Spawn is not started, or Multichar’s Config.spawnSelector is not 'kivo-spawn'.
    • Set Config.debug = true and read the client console (F8). Kivo Spawn prints which mode it started in.
  6. The Last Location card never appears.

    • Config.spawnbehavior.allowLastSpawnLocation is false, or Config.lastSpawnThread is false, or the character has not played since you turned recording on. A brand-new character has no last location.
  7. A location card shows a blank image.

    • The img path is wrong. Use images/<file name> and place the file in html/images/.
  8. I cannot find coordinates for my locations.

  • Other spawn selectors that open by themselves removed
  • Locations configured with id, coords and name
  • Hub camera positioned
  • kivo-spawn loads after your framework
  • Tested with a fresh and a returning character