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. /Examples

Multicharacter

Examples

Ready code snippets for the editable hook files.

On this page10 sections
  • Items on every login
  • One-time starter kit
  • Starter vehicle to the garage
  • Jail or hospital spawn
  • Custom bucket for apartments and instances
  • Block character selection
  • Phone number for a new character
  • Anticheat
  • HUD
  • Send the job to the HUD

Items on every loginLink copied

bridge/server/editable.lua
function SC.Editable.GiveStartingItems(src, citizenid)    exports.ox_inventory:AddItem(src, 'phone', 1)    exports.ox_inventory:AddItem(src, 'water', 2)end

One-time starter kitLink copied

GiveStartingItems runs on every login. To grant a kit once, track it in your own table:

SQL
CREATE TABLE IF NOT EXISTS `my_starter_kits` (    `citizenid` VARCHAR(60) NOT NULL PRIMARY KEY);
bridge/server/editable.lua
function SC.Editable.GiveStartingItems(src, citizenid)    local given = MySQL.scalar.await('SELECT 1 FROM my_starter_kits WHERE citizenid = ?', { citizenid })    if given then return end    exports.ox_inventory:AddItem(src, 'phone', 1)    exports.ox_inventory:AddItem(src, 'id_card', 1)    MySQL.insert.await('INSERT INTO my_starter_kits (citizenid) VALUES (?)', { citizenid })endfunction SC.Editable.OnCharacterDeleted(src, citizenid)    MySQL.query('DELETE FROM my_starter_kits WHERE citizenid = ?', { citizenid })end

Starter vehicle to the garageLink copied

Vehicles from Config.StartingItems with kind = 'vehicle' arrive in OnStartingItemsGranted.

bridge/server/editable.lua
local function randomPlate()    local chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'    local plate    repeat        plate = ''        for _ = 1, 8 do            local i = math.random(1, #chars)            plate = plate .. chars:sub(i, i)        end    until not MySQL.scalar.await('SELECT 1 FROM owned_vehicles WHERE plate = ?', { plate })    return plateendfunction SC.Editable.OnStartingItemsGranted(src, citizenid, lines, total)    for _, line in ipairs(lines) do        if line.kind == 'vehicle' then            local plate = randomPlate()            MySQL.insert.await('INSERT INTO owned_vehicles (owner, plate, vehicle, stored) VALUES (?, ?, ?, ?)', {                citizenid, plate, json.encode({ model = joaat(line.item), plate = plate }), 1,            })        end    endend
bridge/server/editable.lua
local function randomPlate()    local chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'    local plate    repeat        plate = ''        for _ = 1, 8 do            local i = math.random(1, #chars)            plate = plate .. chars:sub(i, i)        end    until not MySQL.scalar.await('SELECT 1 FROM player_vehicles WHERE plate = ?', { plate })    return plateendfunction SC.Editable.OnStartingItemsGranted(src, citizenid, lines, total)    local license = exports.sc_multicharacter:GetCharacter(src).license    for _, line in ipairs(lines) do        if line.kind == 'vehicle' then            MySQL.insert.await('INSERT INTO player_vehicles (license, citizenid, vehicle, hash, mods, plate, garage, state) VALUES (?, ?, ?, ?, ?, ?, ?, ?)', {                license, citizenid, line.item, joaat(line.item), '{}', randomPlate(), 'pillboxgarage', 1,            })        end    endend
bridge/server/editable.lua
function SC.Editable.OnStartingItemsGranted(src, citizenid, lines, total)    for _, line in ipairs(lines) do        if line.kind == 'vehicle' then            exports['my-garage']:AddVehicle(citizenid, line.item, 'pillboxgarage')        end    endend

Match the column and garage names to your garage resource. Table schemas differ between versions and forks.

Jail or hospital spawnLink copied

bridge/server/editable.lua
function SC.Editable.ResolveSpawn(src, character, spawnKey)    if exports['my-jail']:isJailed(character.citizenid) then        return vector4(1690.9, 2565.3, 45.5, 190.0)    end    if character.is_dead then        return vector4(298.6, -584.7, 43.3, 70.0)    end    return nilend

Custom bucket for apartments and instancesLink copied

bridge/server/editable.lua
function SC.Editable.ResolveBucket(src, character)    if exports['my-apartments']:isInside(character.citizenid) then        return exports['my-apartments']:bucketFor(character.citizenid)    end    return nilend

Block character selectionLink copied

bridge/server/editable.lua
function SC.Editable.CanSelectCharacter(src, character)    if exports['my-whitelist']:isBlocked(character.citizenid) then        return false, 'This character is suspended.'    end    return trueend

Phone number for a new characterLink copied

bridge/server/editable.lua
function SC.Editable.OnCharacterCreated(src, character, isFirst)    MySQL.insert('INSERT INTO phone_phones (citizenid, number) VALUES (?, ?)', {        character.citizenid, ('555%04d'):format(math.random(0, 9999)),    })endfunction SC.Editable.OnCharacterDeleted(src, citizenid)    MySQL.query('DELETE FROM phone_phones WHERE citizenid = ?', { citizenid })end

AnticheatLink copied

bridge/client/editable.lua
function SC.Editable.OnStateChanged(state)    exports['my-anticheat']:setEnabled(not state.busy)end

HUDLink copied

bridge/client/editable.lua
function SC.Editable.OnSelectOpened()    exports['my-hud']:hide()endfunction SC.Editable.OnPlayerSpawned(character)    exports['my-hud']:show()end

Send the job to the HUDLink copied

bridge/server/editable.lua
function SC.Editable.OnCharacterLoaded(src, character)    TriggerClientEvent('my-hud:setJob', src, character.job)end
← PreviousExports and EventsMulticharacterNext β†’SecurityMulticharacter

On this page

  • Items on every login
  • One-time starter kit
  • Starter vehicle to the garage
  • Jail or hospital spawn
  • Custom bucket for apartments and instances
  • Block character selection
  • Phone number for a new character
  • Anticheat
  • HUD
  • Send the job to the HUD
↑ 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