Koja Scripts

Configuration

Every option of Koja Multicharacter in shared/config.lua: slots, identity, scene and cutscenes, spawn, relog and admin.

Configuration

All options live in shared/config.lua, spawn points in shared/spawns.lua and webhooks in server/config.lua.

General

KeyDefaultDescription
Config.DebugfalseConsole logs
Config.Locale'en'en or pl. Add your own file in locales/
Config.ServerName'KOJA ROLEPLAY'Shown in the top bar
Config.LogonilImage URL for the top bar
Config.Currency'$'Money prefix
Config.ShowMoneytrueShows cash and bank on the character card
Config.Themeaccent #FF9B00, background #121212, corners roundedUI colours. corners is rounded or sharp

Slots

shared/config.lua
Config.Slots = {
    Default = 3,
    Max = 8,
    ShowLocked = true,
    ShopUrl = nil,
    ImportEsxSlots = true,
    Tiers = {
        { ace = 'koja.multicharacter.slots.vip', slots = 5 },
        { ace = 'koja.multicharacter.slots.staff', slots = 8 },
    },
}
KeyDescription
DefaultSlots for every player
MaxHow many slots the UI shows. Extra ones are drawn as locked
ShowLockedShow locked slots up to Max
ShopUrlLink shown on locked slots, for example your Tebex
ImportEsxSlotsReads multicharacter_slots from the old esx_multicharacter when the player has no own override
Tiers{ ace, slots }. The highest matching tier wins. Overrides from /charslots win over tiers

Identity

KeyDefaultDescription
MinNameLength / MaxNameLength2 / 16Length of first and last name
CapitalizetrueUpper-cases the first letter
MinAge / MaxAge18 / 90Allowed age
Height, MinHeight, MaxHeight, DefaultHeighttrue, 150, 210, 178Height field in cm
Nationality, Nationalitiestrue, 20 entriesNationality field. An empty list turns it into free text
Backstory.Enabled / Required / MaxLengthtrue / false / 600Backstory field
UniqueNamestrueRejects a first and last name that already exists
BlacklistedNamesadmin, staff, ...Rejected names (first, last or full, case-insensitive)
EsxDateFormat'DD/MM/YYYY'Format of users.dateofbirth on ESX: DD/MM/YYYY, MM/DD/YYYY or YYYY-MM-DD

Names allow letters (including accented and Cyrillic), spaces, apostrophes and hyphens.

Delete and presets

KeyDefaultDescription
Config.Delete.EnabledtruePlayers can delete their characters
Config.Delete.ConfirmNametruePlayers must type the full name to delete
Config.Presets.EnabledtrueAppearance presets
Config.Presets.Max6Presets per account

Appearance

KeyDefaultDescription
Resource'auto'Tries koja-appearance / illenium-appearance, fivem-appearance, then qb-clothing and esx_skin. Or set a resource name
AllowPedChangefalseNew characters can pick any ped model in the editor
ForceSavetrueThe editor reopens until the player saves
Menuall trueEditor sections for new characters: headBlend, faceFeatures, headOverlays, components, props, tattoos

Scene

KeyDefaultDescription
RandomtrueRandom location each time, otherwise the first one
LineupfalseAll characters stand next to each other and the camera slides between them
LineupSpacing1.15Distance between characters in the line-up
Hour, Weather19, 'EXTRASUNNY'Default time and weather. A location can override them
CameraDistance, MinDistance, MaxDistance, Height, Side, LookHeight, Fov, Interp (ms)
Scenarios5 scenariosRandom idle scenarios for the preview characters
LocationsVinewood Hills, Michael's House{ label, ped = vec4(...), hour?, weather? }. ped is where the character stands, the camera is placed in front of it

Opening shot

shared/config.lua
Intro = {
    Enabled = true,
    Duration = 3200,
    Distance = 7.5,
    Side = 2.5,
    Height = 2.2,
},

The camera starts wide (Distance, Side and Height are added to the normal pose) and glides in over Duration ms.

Character switch cutscene

shared/config.lua
Transition = {
    Enabled = true,
    WalkDistance = 2.8,
    WalkSpeed = 1.0,
    ExitTime = 2600,
    CameraOut = 700,
    CameraIn = 1900,
    CameraWide = 1.2,
    CameraSwing = 1.1,
    CameraRise = 0.2,
    Gestures = {
        { dict = 'clothingshirt', anim = 'try_shirt_positive_d' },
        { dict = 'clothingtie', anim = 'try_tie_positive_a' },
        { dict = 'clothingspecs', anim = 'try_glasses_positive_a' },
        { dict = 'anim@mp_player_intupperthumbs_up', anim = 'idle_a' },
    },
},
KeyDescription
Enabledfalse swaps characters instantly
WalkDistance, WalkSpeedHow far and how fast the new character walks in
ExitTimeMs before the old character is removed
CameraOut, CameraInMs for the camera to swing out and back
CameraWide, CameraSwing, CameraRiseHow far the camera pulls back, moves sideways and rises during the swing
GesturesAnimations the new character plays on arrival, one picked at random. A missing animation is skipped

Spawn

KeyDefaultDescription
SelectortrueShow the spawn selector, otherwise spawn at the last location
UseKojaSpawnSelectortrueWhen koja-spawnselector is started, use its map instead of the built-in screen
NewCharacterSelectorfalseNew characters also pick a spawn, otherwise they go to NewCharacterSpawn
NewCharacterSpawnairportWhere new characters arrive
LastLocationtrueOffer the last location
AllowBacktrueBack button from the spawn selector to the characters
TriggerPlayerSpawnedfalseAlso fires the classic playerSpawned event
CameraSky camera Height, Back, Interp and Fov
Protection10 sEnabled, Duration (s), Ghost, Invincible, DisableFiring, Alpha

Spawn points in shared/spawns.lua use the same fields as the RegisterSpawn export.

Relog

KeyDefaultDescription
Enabled, Commandtrue, 'relog'The switch character command
Cooldown60Seconds after spawning before switching is allowed
CombatSeconds30Blocks switching for this long after damage was dealt or taken
BlockWhenDead, BlockInVehicletrue, trueExtra checks
Progress3000Progress bar length in ms. 0 is instant

Other

KeyDefaultDescription
Config.Bucket.Enabled / Offsettrue / 5000Private routing bucket (Offset + server id) while choosing
Config.Playtime.SaveInterval300Seconds between playtime saves
Config.StarterItemsphone, water, breadItems given to a new character on first spawn
Config.Esx.Prefix'char'ESX character prefix, char1:license
Config.Esx.AutoResizeColumnstrueWidens identifier / owner columns so the prefix fits
Config.AdminGroups, ACE and command names, see Commands