# esx\_multicharacter

{% hint style="danger" %}
If you using **esx\_multicharacter** you need change only this, **do not change esx\_identity**!
{% endhint %}

***

{% tabs %}
{% tab title="v1.8.X" %}

1. Open **esx\_multicharacter/client/main.lua**
2. Search for `esx:playerLoaded`
3. Replace the trigger with this one below

```lua
RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded', function(playerData, isNew, skin)
    local spawn = playerData.coords or Config.Spawn
    if isNew or not skin or #skin == 1 then
        skin = Config.Default[playerData.sex]
        skin.sex = playerData.sex == "m" and 0 or 1
        local model = skin.sex == 0 and mp_m_freemode_01 or mp_f_freemode_01
        RequestModel(model)
        while not HasModelLoaded(model) do
            RequestModel(model)
            Wait(0)
        end
        SetPlayerModel(PlayerId(), model)
        ResetEntityAlpha(PlayerPedId())
        SetModelAsNoLongerNeeded(model)
        TriggerEvent('skinchanger:loadSkin', skin, function()
            ResetEntityAlpha(PlayerPedId())
            SetPedAoBlobRendering(PlayerPedId(), true)
            
            -- The event launching the VMS Char Creator was introduced here --
            TriggerEvent('vms_charcreator:openCreator', skin.sex, false, false)
            -- The event launching the VMS Char Creator was introduced here --
            
        end)
    end
    if not isNew then
        DoScreenFadeOut(100)
    end
    SetCamActive(cam, false)
    RenderScriptCams(false, false, 0, true, true)
    cam = nil
    SetEntityCoordsNoOffset(PlayerPedId(), spawn.x, spawn.y, spawn.z, false, false, false, true)
    SetEntityHeading(PlayerPedId(), spawn.heading)
    if not isNew then 
        TriggerEvent('skinchanger:loadSkin', skin or Characters[spawned].skin) 
        Wait(400)
        DoScreenFadeIn(400)
        repeat Wait(200) until not IsScreenFadedOut()
    end
    TriggerServerEvent('esx:onPlayerSpawn')
    TriggerEvent('esx:onPlayerSpawn')
    TriggerEvent('playerSpawned')
    TriggerEvent('esx:restoreLoadout')
    Characters, hidePlayers = {}, false
end)
```

{% endtab %}

{% tab title="v1.12.X" %}

1. Open **esx\_multicharacter/client/modules/multicharacter.lua**
2. Search for `esx:playerLoaded`
3. Replace the trigger with this one below

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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://docs.vames-store.com/assets/vms_charcreator/compatibility/esx_multicharacter.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.
