SleepyCode
Home
AboutBlogSubscriptionDocs
Cart0
SleepyCode
Cart0
  • πŸ’£Documentation

Scripts

  • Multicharacter
    • Features
    • Installation
    • Framework Setup
    • Core Settings
    • Characters and Slots
    • Identity
    • Spawn Selector
    • Camera and Scene
    • Arrival and Welcome
    • Starting Items
    • Loading Screen
    • Discord
    • Logs
    • Theme and Branding
    • Translations
    • Commands and Permissions
    • Database
    • Integrations
    • Hooks
    • Exports and Events
    • Examples
    • Security
    • Troubleshooting
  • DevTool
  • Fishing
  • πŸ—ƒοΈGarages V2
  • 🚌Bus Job
  • πŸš—Vehicle Shop V1
  • πŸ—ƒοΈGarages V1
  • 🍁Selldrugs
  • πŸŽ…Advent Calendar
  1. Docs
  2. /Multicharacter
  3. /Exports and Events

Multicharacter

Exports and Events

Client and server exports and events for other resources.

On this page6 sections
  • Client exports
  • Server exports
  • Character data
  • Client events
  • Server events
  • Framework events

Client exportsLink copied

Lua
exports.sc_multicharacter:IsBusy()exports.sc_multicharacter:IsOpen()exports.sc_multicharacter:IsSpawned()exports.sc_multicharacter:GetCharacter()exports.sc_multicharacter:GetCitizenId()
ExportReturns
IsBusy()true until the player is actually playing (loading, select, editor, spawn, arrival)
IsOpen()true while the resource UI is on screen
IsSpawned()The opposite of IsBusy()
GetCharacter()Copy of the current character data or nil
GetCitizenId()Citizen id of the current character or nil

Example for an anticheat:

Lua
if exports.sc_multicharacter:IsBusy() then return end

Server exportsLink copied

Lua
exports.sc_multicharacter:IsSelecting(source)exports.sc_multicharacter:IsPlaying(source)exports.sc_multicharacter:GetCharacter(source)exports.sc_multicharacter:GetCitizenId(source)exports.sc_multicharacter:GetCharacters(license)exports.sc_multicharacter:GetPlayingCharacters()
ExportReturns
IsSelecting(source)true when connected but no character is selected yet
IsPlaying(source)true when playing a character
GetCharacter(source)Live character data with current position, money, and job
GetCitizenId(source)Citizen id of the current character or nil
GetCharacterId(source)Same as GetCitizenId
GetCharacters(license)List of all characters of a license
GetPlayingCharacters(){ [source] = citizenid } for everyone playing

Character dataLink copied

GetCharacter returns the same shape on every framework:

FieldDescription
citizenidCharacter identifier
licensePlayer identifier
cidSlot number
firstname, lastnameName
birthdateBirth date
gender0 male, 1 female
nationalityNationality
height, weightHeight and weight
appearanceSaved appearance
job{ name, label, grade, gradeLabel }
gangGang on QBCore and Qbox
money{ cash, bank }
metadataMetadata
position{ x, y, z, heading }
is_deadWhether the character is dead
last_playedLast played

Client eventsLink copied

EventArgumentsWhen
sc_multicharacter:stateChangedstateStage change. state is { open, spawned, busy, citizenid }. Only on a real change.
sc_multicharacter:playerLoadedcharacterThe character is known, before spawn
sc_multicharacter:playerSpawnedcharacterThe flow ended and the player has control
sc_multicharacter:inventoryReadycitizenidThe character inventory exists
Lua
AddEventHandler('sc_multicharacter:playerSpawned', function(character)    print(('Playing as %s %s'):format(character.firstname, character.lastname))end)AddEventHandler('sc_multicharacter:stateChanged', function(state)    DisplayRadar(state.spawned)end)

Server eventsLink copied

EventArgumentsWhen
sc_multicharacter:characterCreatedsource, character, isFirstCharacter saved in the database
sc_multicharacter:characterDeletedsource, citizenidCharacter deleted
sc_multicharacter:playerLoadedsource, characterSelected and handed to the framework
sc_multicharacter:playerLogoutsource, citizenidRelog or disconnect
sc_multicharacter:inventoryReadysource, citizenidThe character inventory exists
sc_multicharacter:startingItemsGrantedsource, citizenid, lines, totalStarter basket granted
sc_multicharacter:bridgeReadyframeworkNameFramework detected and ready
Lua
AddEventHandler('sc_multicharacter:characterCreated', function(source, character, isFirst)    if isFirst then        print(('New player: %s %s'):format(character.firstname, character.lastname))    endend)AddEventHandler('sc_multicharacter:characterDeleted', function(source, citizenid)    MySQL.query('DELETE FROM my_table WHERE citizenid = ?', { citizenid })end)

Server events are local server events (AddEventHandler), not network events. A client cannot trigger them.

Framework eventsLink copied

After selection, the character is handed to the framework with its own method, such as ESX esx:onPlayerJoined, QBCore Player.Login, or Qbox Login.

The framework then fires its standard events, such as esx:playerLoaded or QBCore:Client:OnPlayerLoaded. Resources waiting for them work unchanged.

← PreviousHooksMulticharacterNext β†’ExamplesMulticharacter

On this page

  • Client exports
  • Server exports
  • Character data
  • Client events
  • Server events
  • Framework events
↑ Back to top
Ready when you are

Put your server on something that holds up

150+ servers run our resources - ESX, QBCore and standalone. Once the payment clears, the package is waiting in Keymaster.

Browse the catalogueAsk on Discord β†—
  • Delivered instantly
  • Support with no expiry
  • 100+ reviews
  • Payment via Tebex

SleepyCode

FiveM Scripts

Checkout is run by Tebex Limited- they handle payment, invoicing and refunds. Β© 2026

Community

  • Discord
  • YouTube
  • X (Twitter)

Navigation

  • Home
  • All Scripts
  • ESX Scripts
  • QBCore Scripts
  • Free Scripts
  • About
  • Blog
  • Documentation
  • Support

Legal

  • Privacy Policy
  • Tebex Privacy Policy
  • Terms of Service
  • Impressum

Β© 2026 SleepyCode. Not affiliated with Rockstar Games or Take-Two Interactive.

Powered byTebex