Skip to content

Multicharacter — Editable Files (Client) ​

FileWhat it is for
bridge/hooks/client.luaYour own client rules
bridge/spawnselector.luaUse your own spawn selector instead of the map
bridge/appearance/<script>/client.luaOne folder per appearance script
bridge/framework/<esx, qbcore, qbox>/client.luaThe framework code

Hooks — bridge/hooks/client.lua ​

HookdataChangeable
before.openSelectrelog—
before.scenePedcharacter, look, anim, positionlook, anim (return false = no ped)
before.openCreatorsex, modelreturn false = open your own creator
before.spawnplace, isNew, positionposition

after events: selectOpened, focused, loaded, creatorClosed, spawned. Each is also sent as fwb_multicharacter:client:<event>.


Your own character creator ​

lua
function before.openCreator(data)
    TriggerEvent('my_creator:open', data.sex)
    return false
end

-- in your creator, when the player is done:
exports.fwb_multicharacter:CreatorDone(true)

The spawn map opens after CreatorDone.


Your own spawn selector — bridge/spawnselector.lua ​

Set builtin = false and write SpawnSelector.open:

lua
SpawnSelector = { builtin = false }

function SpawnSelector.open(data, choose, spawnAt)
    -- data = { isNew, last, homes = { ... }, places = { ... } }
    exports['my-spawn']:Open(data.places, function(place) choose(place.id) end)
end
  • choose(id) — 'last', a home id or a place id. The server checks it and gives the real position.
  • spawnAt({ x, y, z, h }) — any position you worked out yourself.

Call one of them once; the script then puts the player there and finishes the login.

FWB Studio documentation.