> For the complete documentation index, see [llms.txt](https://docs.otherplanet.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.otherplanet.dev/scripts/op-multicharacter/installation.md).

# Installation

## Downloading Dependencies

Dependencies are very important — you need to install them before moving on to the installation of our script.

{% stepper %}
{% step %}

### ox\_lib

{% embed url="<https://github.com/overextended/ox_lib>" %}
{% endstep %}
{% endstepper %}

***

## Server.cfg

All dependencies you’ve installed must be started before our script. Make sure to follow the correct start-up order in your `server.cfg`.

```
ensure ox_lib
ensure op-multicharacter
```

***

## Additional Steps (Important):

{% tabs %}
{% tab title="ESX" %}

1. Go to your `es_extended`
2. Find config file located in `shared/config/main.lua`
3. Change line:

* From: `Config.Multichar = GetResourceState("esx_multicharacter") ~= "missing"`  &#x20;
* To: `Config.Multichar = true`&#x20;
  {% endtab %}

{% tab title="QBOX" %}

1. Go to your qbx\_core
2. Find config located in config/client.lua

* Change `useExternalCharacters` to true&#x20;

Before:&#x20;

<figure><img src="/files/nwzax3dWMuipcI0lDW3I" alt=""><figcaption></figcaption></figure>

After:

<figure><img src="/files/LIE987o9TNfCkxNl7TdT" alt=""><figcaption></figcaption></figure>

3. Find resource:  `qbx_properties`
4. Go to `qbx_properties/server/apartmentselect.lua`
5. Find event `QBCore:Server:OnPlayerLoaded`

* Replace this:

  ```lua
  RegisterNetEvent('QBCore:Server:OnPlayerLoaded', function()
      local playerSource = source --[[@as number]]
      local player = exports.qbx_core:GetPlayer(playerSource)
      local hasApartment = MySQL.single.await('SELECT * FROM properties WHERE owner = ?', {player.PlayerData.citizenid})
      if not hasApartment then
          TriggerClientEvent('apartments:client:setupSpawnUI', playerSource)
      end
  end)
  ```
* With This:

  ```lua
  RegisterNetEvent('QBCore:Server:OnPlayerLoaded', function()
      local playerSource = source --[[@as number]]
      local player = exports.qbx_core:GetPlayer(playerSource)
      local hasApartment = MySQL.single.await('SELECT * FROM properties WHERE owner = ?', {player.PlayerData.citizenid})
      if not hasApartment then
          --TriggerClientEvent('apartments:client:setupSpawnUI', playerSource)
      end
  end)
  ```

{% endtab %}

{% tab title="QBCore" %}
Only If you're using qb-clothing:

{% embed url="<https://docs.otherplanet.dev/scripts/op-multicharacter/integrations/qb-clothing>" %}
{% endtab %}
{% endtabs %}

***

## Final Step

Make sure you deleted other Multicharacter scripts from your server, like esx\_multicharacter or qb-multicharacter!


---

# 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.otherplanet.dev/scripts/op-multicharacter/installation.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.
