Skip to content

Configuration ​

The look of the spirit (pose, particles, sound) is set in game with the menu. See the User Guide. config.lua holds the server options below. After changing one, run restart leno_spirit_pro.

General ​

OptionDefaultDescription
Config.Locale'en'File in locales/. en and pt are included.
Config.Notify'default''default' (GTA feed) | 'ox_lib' | 'okokNotify' | 'qb' | 'esx' | 'custom'. See Customization.
Config.Permissions.admin'leno_spirit.admin'ACE permission for the menu and the staff commands. Same as the free version.
Config.Commandsspiritadmin, spirit, spirittestCommand names. See Commands.
General.enabledtrueThe effect in Automatic mode. On / Off in the menu override it.
General.activePeriod'always''always', or a list of months: { 10 } = October only, { 10, 11 } = October and November. Uses the server clock.
General.visibility'nearby''local' = only the player who died sees the spirit. 'nearby' = every player within nearbyRadius (needs OneSync).
General.nearbyRadius40.0Metres
General.triggerMode'native'When the effect fires. See Trigger modes.
General.cooldownSeconds3Minimum time between two spirits of the same player
General.startDelayMs1200Delay after death before the spirit appears, so the body falls first
General.maxSpirits4How many spirits one client draws at the same time
Config.CustomSounds3 included soundsYour own sound files for the menu. See Customization.
Config.DebugfalseDebug lines in the F8 and server consoles. Keep it false on a live server.

Trigger modes ​

ModeFires whenNotes
'native'GTA kills the player's pedWorks on every server. On qb-ambulancejob and wasabi_ambulance, this is when the player goes down (last stand).
'framework'The framework marks the player deadESX: esx:onPlayerDeath. QBCore: metadata.isdead changes to true.
'manual'Your script calls the exportNo automatic detection. Use it with exports.leno_spirit_pro:Trigger(). See Exports and Events.

Local visibility ​

With General.visibility = 'local', the effect plays only in the dead player's own game and the death never reaches the server. The server cooldown and SpiritHooks.CanTrigger don't apply then; the client cooldown still does.

The menu block ​

Everything between -- [menu:start] and -- [menu:end] (Config.Menu) is written by the menu: the On / Off / Automatic mode, the spirit, the poses, the particles and the sound.

  • Edit it by hand only while the server is stopped. A running server overwrites it on the next save.
  • An invalid block is ignored at start: the defaults are used, the file isn't changed, and the server console lists what is wrong.
  • Every save first copies the current config.lua to data/backups/. The last 10 copies are kept. To go back to an older version, stop the server and copy a backup over config.lua.

Default config.lua ​

The menu block below shows the shipped look. Yours changes every time staff save in the menu.

lua
--[[
    add_ace group.admin leno_spirit.admin allow
]]

Config = {}

-- Locale file in locales/{locale}.json
Config.Locale = 'en'

-- 'default' | 'ox_lib' | 'okokNotify' | 'qb' | 'esx' | 'custom'
Config.Notify = 'default'

-- Same ace as the free leno_spirit
Config.Permissions = {
    admin = 'leno_spirit.admin',
}

Config.Commands = {
    admin = 'spiritadmin', -- staff: menu, or /spiritadmin on | off | auto
    toggle = 'spirit',     -- everyone: hide / show spirits
    test = 'spirittest',   -- staff: /spirittest [id]
}

Config.General = {
    enabled = true,
    activePeriod = 'always', -- 'always' | { 10 } | { 10, 11 } (months)
    visibility = 'nearby',   -- 'local' | 'nearby' (needs OneSync)
    nearbyRadius = 40.0,
    triggerMode = 'native',  -- 'native' | 'framework' | 'manual' (exports.leno_spirit_pro:Trigger())
    cooldownSeconds = 3,
    startDelayMs = 1200,
    maxSpirits = 4,          -- per client
}

-- Files in sounds/ (.ogg or .mp3)
Config.CustomSounds = {
    { file = 'spirit_chime.ogg', label = 'Spirit chime' },
    { file = 'spirit_rise.ogg', label = 'Spirit rise' },
    { file = 'spirit_release.ogg', label = 'Spirit release' },
}

Config.Debug = false

-- [menu:start] Saved by /spiritadmin. Only edit by hand with the server stopped.
Config.Menu = {
    active = "auto",
    particles = {
        enabled = true,
        finish = { alpha = 1, asset = "scr_rcbarry2", enabled = true, name = "scr_clown_death", offsetZ = -0.7, rotX = 0, rotY = 0, rotZ = 0, scale = 1.2 },
        finishHideDelayMs = 150,
        start = { alpha = 1, asset = "scr_rcbarry2", enabled = true, name = "scr_clown_appears", offsetZ = 0, rotX = 0, rotY = 0, rotZ = 0, scale = 1 },
        trail = { alpha = 0.05, asset = "scr_rcbarry1", enabled = true, intervalMs = 700, name = "scr_alien_teleport", offsetZ = 0, rotX = 90, rotY = 0, rotZ = 0, scale = 0.9 },
    },
    poses = {
        dead = { dict = "missprologueig_6", heightAboveGround = 1, label = "Dead", name = "lying_dead_player0", rotX = 0, rotY = 0, rotZ = 0, source = "base" },
        freefall = { dict = "skydive@base", heightAboveGround = 1, label = "Free fall", name = "free_idle", rotX = 180, rotY = 0, rotZ = 0, source = "base" },
        lying = { dict = "mini@cpr@char_b@cpr_def", heightAboveGround = 1, label = "Lying", name = "cpr_pumpchest_idle", rotX = 0, rotY = 0, rotZ = 0, source = "base" },
        meditate = { dict = "rcmcollect_paperleadinout@", heightAboveGround = 1, label = "Meditate", name = "meditiate_idle", rotX = 0, rotY = 0, rotZ = 0, source = "base" },
        sunbathe = { dict = "amb@world_human_sunbathe@male@back@base", heightAboveGround = 1, label = "Sunbathe", name = "base", rotX = 0, rotY = 0, rotZ = 0, source = "base" },
        tpose = { dict = "missfam5_yoga", heightAboveGround = 1, label = "T-pose", name = "a2_pose", rotX = 0, rotY = 0, rotZ = 0, source = "base" },
        ufo_float = { dict = "anim@scripted@freemode@ufo_invasion@ufo_float@male@", heightAboveGround = 1, label = "Float", name = "float", rotX = 0, rotY = 0, rotZ = 0, source = "base" },
    },
    sound = {
        enabled = true,
        finish = { enabled = true, name = "Short_Transition_Out", set = "PLAYER_SWITCH_CUSTOM_SOUNDSET", source = "game", volume = 0.8 },
        range = 30,
        start = { enabled = true, file = "spirit_release.ogg", name = "Short_Transition_In", set = "PLAYER_SWITCH_CUSTOM_SOUNDSET", source = "custom", volume = 0.05 },
    },
    spirit = { durationMs = 7000, fadeFrom = 0.6, pose = "freefall", removeProps = false, riseHeight = 4, spin = 360, startAlpha = 153 },
    version = 26,
}
-- [menu:end]