# wais\_multicharacter v2

Open wais multichar's config and find the following two lines that start with

```lua
Config.Skinchanger = 
Config.Appearance = 
```

and replace them with

```lua
Config.Skinchanger = GetResourceState('skinchanger') == 'started' and GetResourceState('illenium-appearance') ~= "started" and GetResourceState('fivem-appearance') ~= "started" and GetResourceState('rcore_clothing') ~= "started" and true or false or false or false or false -- ESX Frameworks are also for detecting skinchange usage. Don't touch it.
Config.Appearance = GetResourceState('rcore_clothing') == 'started' and 'rcore_clothing' or GetResourceState('illenium-appearance') == 'started' and 'illenium-appearance' or GetResourceState('fivem-appearance') == 'started' and 'fivem-appearance' or GetResourceState('codem-appearance') == 'started' and 'codem-appearance' or false -- Appearance name for the script to detect and use the appearance system.
```

Next find the following line of code `Config.GetPlayerSkin = function(requiredId, cb)` and replace it with

```lua
Config.GetPlayerSkin = function(requiredId, cb)
    if GetResourceState('rcore_clothing') == 'started' then
        local skinData = exports["rcore_clothing"]:getSkinByIdentifier(requiredId)
        if skinData then
            cb(skinData.ped_model, skinData.skin)
        else
            cb(nil)
        end
        return
    end
```

Next find the following line of code `Config.SetPedClothing = function(ped, skin)` and replace it with

```lua
Config.SetPedClothing = function(ped, skin)
    -- It is a function to load the clothes of the pads in the character menu.
    if GetResourceState('rcore_clothing') == 'started' then
        exports['rcore_clothing']:setPedSkin(ped, skin)
        return
    end
```

Next find the following code block inside Config.CreatedNewCharacter = function(data) around line \~280

```lua
            if GetResourceState('vms_charcreator') == 'started' then
                TriggerEvent('vms_charcreator:openCreator')
            end
        elseif Config.Appearance then
            TriggerEvent("esx_skin:openSaveableMenu", function() end, function() end)
        end
    elseif Config.Framework.Framework == "qbcore" then
        if GetResourceState('vms_charcreator') == 'started' then
            TriggerEvent('vms_charcreator:openCreator')
        end
```

and replace it with the following code

```lua
            if GetResourceState('rcore_clothing') == 'started' then
                TriggerEvent('rcore_clothing:esx:charcreator')
            elseif GetResourceState('vms_charcreator') == 'started' then
                TriggerEvent('vms_charcreator:openCreator')
            end
        elseif Config.Appearance then
            TriggerEvent("esx_skin:openSaveableMenu", function() end, function() end)
        end
    elseif Config.Framework.Framework == "qbcore" then
        if GetResourceState('rcore_clothing') == 'started' then
            TriggerEvent('rcore_clothing:qb:charcreator')
        elseif GetResourceState('vms_charcreator') == 'started' then
            TriggerEvent('vms_charcreator:openCreator')
        end
```

Next find the following code block

```lua
Config.CharacterSelected = function(charid, skinData)
    -- When a person selects a character and presses the play button, the selected character comes as citizenid or char1...5
    -- You can spawn the character selector with export or trigger here. 
    -- skinData = {model = charModel, skin = charSkin}
    SetEntityVisible(PlayerPedId(), true)

    if Config.Appearance then
        exports[Config.Appearance]:setPedAppearance(PlayerPedId(), skinData.skin)
```

and replace it with the following codeblock

```lua
Config.CharacterSelected = function(charid, skinData)
    -- When a person selects a character and presses the play button, the selected character comes as citizenid or char1...5
    -- You can spawn the character selector with export or trigger here. 
    -- skinData = {model = charModel, skin = charSkin}
    SetEntityVisible(PlayerPedId(), true)

    if Config.Appearance then
        if GetResourceState('rcore_clothing') == 'started' then
            exports['rcore_clothing']:setPedSkin(PlayerPedId(), skinData.skin)
        else
            exports[Config.Appearance]:setPedAppearance(PlayerPedId(), skinData.skin)
        end
```


---

# 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://documentation.rcore.cz/paid-resources/rcore_clothing/impl/wais_multichar.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.
