> For the complete documentation index, see [llms.txt](https://docs.0resmon.org/0resmon/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.0resmon.org/0resmon/wais-resoucres/wais-multicharacterv2/installation-qbcore/old-qbcore-adapt.md).

# Old QBCore Adapt

{% hint style="danger" %}
Incomplete or incorrect installation will result in a multicharacter error and will not save your new characters.
{% endhint %}

{% hint style="warning" %}
qb-multicharacter should be disabled or deprecated.
{% endhint %}

{% hint style="info" %}
Visit this folder for the changes we will make.

*<mark style="background-color:green;">**qb-core/server/player.lua**</mark>*
{% endhint %}

***

* <mark style="background-color:orange;">function QBCore.Player.CreatePlayer(PlayerData, Offline)</mark> The specified function must be found and go to the last line of this function.
* Then the following codes should be pasted

```lua
TriggerEvent('wais:sendNewCharacterData', PlayerData.source, PlayerData.cid, PlayerData.citizenid)
```

{% hint style="info" %}
After pasting the code above, it should look like below.
{% endhint %}

```lua
function QBCore.Player.CreatePlayer(PlayerData, Offline)
    local self = {}
    self.Functions = {}
    self.PlayerData = PlayerData
    self.Offline = Offline

    -- THESE PLACES ARE ACTUALLY FULL OF CODES
    -- THESE PLACES ARE ACTUALLY FULL OF CODES

    self.Functions.Save = function()
        QBCore.Player.Save(self.PlayerData.source)
    end

    QBCore.Players[self.PlayerData.source] = self
    QBCore.Player.Save(self.PlayerData.source)

    -- At this point we are safe to emit new instance to third party resource for load handling
    TriggerEvent('QBCore:Server:PlayerLoaded', self)
    self.Functions.UpdatePlayerData()
    TriggerEvent('wais:sendNewCharacterData', PlayerData.source, PlayerData.cid, PlayerData.citizenid)
end
```

{% hint style="danger" %}
**If you have a newer player lua file it should look like below.**
{% endhint %}

```lua
function QBCore.Player.CreatePlayer(PlayerData, Offline)
    local self = {}
    self.Functions = {}
    self.PlayerData = PlayerData
    self.Offline = Offline

   -- THESE PLACES ARE ACTUALLY FULL OF CODES
   -- THESE PLACES ARE ACTUALLY FULL OF CODES
   -- THESE PLACES ARE ACTUALLY FULL OF CODES

    if self.Offline then
        return self
    else
        QBCore.Players[self.PlayerData.source] = self
        QBCore.Player.Save(self.PlayerData.source)

        -- At this point we are safe to emit new instance to third party resource for load handling
        TriggerEvent('QBCore:Server:PlayerLoaded', self)
        self.Functions.UpdatePlayerData()
    end

    TriggerEvent('wais:sendNewCharacterData', PlayerData.source, PlayerData.cid, PlayerData.citizenid)
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, and the optional `goal` query parameter:

```
GET https://docs.0resmon.org/0resmon/wais-resoucres/wais-multicharacterv2/installation-qbcore/old-qbcore-adapt.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
