> For the complete documentation index, see [llms.txt](https://stg-store.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stg-store.gitbook.io/documentation/scripts/multicharacter/configuration.md).

# Configuration

***

<mark style="color:$success;">server\_config.lua</mark>

```lua
ServerConfig = {}

ServerConfig.Tebex = {
    Enabled = true,
    Secret = "SECRET_KEY",
    PackageId = 0000000
}
```

<mark style="color:$success;">config.lua</mark>

```lua
Config = {}

Config.MaxCharacters = 4
Config.FreeSlotAmount = 2

Config.Debug = false
Config.Language = 'en' -- en, de, fr, es, pt, it, nl, pl, sv, ar, jp, zh, he
Config.Locales = {}
Config.Theme = "light" -- light, dark

Config.DefaultCountry = 'UNITED STATES' -- Default nationality for new characters (for esx users)
Config.prefixForESX = "char" -- if you dont use esx, dont touch this part.

Config.FirstSpawn = {x = -1035.71, y = -2731.87, z = 12.86, w = 0.0}

Config.Notify = function(type, message)
    lib.notify({
        title = "Mulicharacter",
        description = message,
        type = type,
        duration = 5000,
        position = 'center-right'
    })
end

-- Starter Items - Automatically given to new characters
Config.StarterItems = {
    {
        item = "bread",
        amount = 5
    },
    {
        item = "water",
        amount = 5
    },
    {
        item = "coffee",
        amount = 5
    },
    {
        item = "sandwich",
        amount = 5
    }
}

Config.OnCharacterCreated = function(source, identifier, characterData)
    -- This callback is called after a NEW character is created
    -- You can add custom logic like giving money, etc.

    -- Example: Give starter money
    -- local Player = exports['stg_lib']:getPlayer(source)
    -- if Player then
    --     Player.addMoney('cash', 5000)
    --     Player.addMoney('bank', 25000)
    -- end
end

Config.OnCharacterLoaded = function(source, identifier, characterData)
    -- This callback is called when an EXISTING character is loaded/selected
    -- You can add custom logic here

    -- Example: Log character selection
    -- print(('[STG-Multicharacter] Player %s loaded character %s'):format(source, identifier))

    -- Example: Trigger custom event
    -- TriggerClientEvent('your-script:characterLoaded', source, characterData)
end

Config.SkinSystem = 'auto' -- auto, rcore_clothing, illenium-appearance, fivem-appearance, esx_skin, skinchanger

-- Auto-detection order (first found will be used)
Config.SkinAutoDetect = {
    'rcore_clothing',
    'illenium-appearance',
    'fivem-appearance',
    'skinchanger',
    'esx_skin',
}

-- Skin system handlers for LOADING existing skin
Config.SkinSystems = {
    ['rcore_clothing'] = function(skin, playerPed)
        exports['rcore_clothing']:setPlayerSkin(skin, false)
    end,

    ['esx_skin'] = function(skin, playerPed)
        TriggerEvent('esx_skin:setLastSkin', skin)
        TriggerEvent('skinchanger:loadSkin', skin)
    end,

    ['skinchanger'] = function(skin, playerPed)
        TriggerEvent('skinchanger:loadSkin', skin)
    end,

    ['fivem-appearance'] = function(skin, playerPed)
        exports['fivem-appearance']:setPlayerAppearance(skin)
    end,

    ['illenium-appearance'] = function(skin, playerPed)
        exports['illenium-appearance']:setPedAppearance(playerPed, skin)
    end,
}

-- Skin menu handlers for NEW character creation (opens customization menu)
Config.SkinMenus = {
    -- illenium-appearance, fivem-appearance and qb-clothing working auto
    ['esx_skin'] = function(callback)
        TriggerEvent('esx_skin:openSaveableMenu', function(data)
            if callback then callback(data) end
        end, true)
    end,

    ['skinchanger'] = function(callback)
        TriggerEvent('skinchanger:openMenu', function(data)
            if callback then callback(data) end
        end)
    end,

    ['rcore_clothing'] = function(callback)
        exports['rcore_clothing']:openMenu(function(data)
            if callback then callback(data) end
        end)
    end,
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://stg-store.gitbook.io/documentation/scripts/multicharacter/configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
