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

# Configuration

Configure 0Bug Multicharacter V2: character slots, Tebex and Discord slots, character creation, spawn, starter items, music, theme and languages.

All settings are in `0bug_Multicharacter/Customize.lua`. Framework, clothing, starting apartments and housing are set once in [0bug-core](https://0bugscripts.gitbook.io/0bugscripts/0bug-core/settings).

### Language

```lua
Language = "en", -- en, de, fr, es, pt (Brazilian), it, nl, pl, tr
Debug = false,   -- extra information in the F8 and server console
```

### Character slots

```lua
Slots = {
    Free = 5, -- slots every player has
    Tebex = { Enabled = true, Command = "buySlot" },
    Discord = {
        Enabled = false,
        Roles = { ["123456789012345678"] = 2 } -- role ID = extra slots
    }
},
```

A player's slots are **Free + Tebex slots + Discord role slots**. Characters over that number stay in the list, **locked**, until the player has the slots again. Setup: [Tebex and Discord slots](https://0bugscripts.gitbook.io/0bugscripts/multicharacter-v2/installation).

### Deleting characters

```lua
Delete = {
    Enabled = true,
    DiscordRoles = {} -- only these Discord roles may delete (empty: everyone)
},
```

### Logout command

```lua
Logout = {
    Command = "logout",
    Permission = "admin" -- who may use it
},
```

### Character creation

```lua
Creation = {
    MinAge = 18,
    MaxFirstNameLength = 18,
    MaxLastNameLength = 11,
    Nationalities = {}, -- e.g. {"Germany", "England"}: only these (empty: every country)
    ForbiddenWords = { "admin", "staff", ... }, -- names containing these are refused
    Rules = {
        Enabled = true, -- false: no rules screen
        List = {
            { title = "Roleplay", value = { "Stay in character (IC) at all times." } },
        }
    },
    CustomClothingMenu = false -- or a function(data) to open your own creator (data.gender = "M" / "F")
},
```

### Spawn

```lua
Spawn = {
    Selector = "0bug_Spawnselector", -- "0bug_Spawnselector", "qb-spawn" or "none"
    -- where a new character can start (when starting apartments are off)
    Locations = {
        { name = "Los Santos Airport", address = "LSIA Terminal", coords = vector3(-1035.71, -2731.87, 12.86), type = "pin" },
        { name = "Downtown", address = "Alta St. 203", coords = vector3(233.07, -877.79, 30.49), type = "pin" }
    },
},
```

* **0bug\_Spawnselector**: a new character picks one of these `Locations` (or an apartment), then makes their look. Existing characters get the full [Spawn Selector](https://0bugscripts.gitbook.io/0bugscripts/spawn-selector-v2).
* **qb-spawn**: opens qb-spawn and qb-apartments.
* **none**: new characters start at a random `Locations` entry, others at their last location.

`Spawn.Open` is the function that opens the selector. Change it only to use another spawn script.

### Starter items

```lua
StarterItems = {
    Enabled = true,
    QBCore = { { item = "phone", amount = 1 }, { item = "id_card", amount = 1 } },
    QBox   = { { item = "phone", amount = 1 }, { item = "id_card", amount = 1 } },
    ESX    = { { item = "water", amount = 1 }, { item = "burger", amount = 1 } }
},
```

### Interface

```lua
UI = {
    Template = {
        enable = false, -- true: these colors and layout for everyone
        positioning = "vertical", -- "vertical" or "horizontal"
        primaryColor = "#00CCB8",
        secondaryColor = "#ffd95a",
        progressBarStyle = "circle" -- "circle" or "bar"
    },
    ProgressBarLogo = true -- your logo on the loading bar
},
```

With `enable = false`, every player picks their own colors and layout in the settings menu. The colors are shared with the Spawn Selector.

### Music

```lua
Music = {
    Enabled = true,
    AutoPlay = true,
    Shuffle = true,
    Songs = {
        { title = "City In The Rearview", artist = "HoliznaCC0", url = "city-in-the-rearview.mp3", id = "1" },
    }
},
```

The included tracks are royalty-free (CC0). To add your own, put the `.mp3` in `resources/sounds/sounds` (and an optional cover `.png` in `resources/sounds/images`), then add a line with `url = "your-song.mp3"`. A link (`https://...mp3`) works too. Only use music you have the rights to.

### Your own code

```lua
OnScreen = function(open) DisplayRadar(false) end, -- the character screen opens / closes
PauseWeatherSync = function() TriggerEvent('qb-weathersync:client:DisableSync') end,
ResumeWeatherSync = function() TriggerEvent('qb-weathersync:client:EnableSync') end,
LoadSkin = function(character) ... end, -- ESX: puts the look on the player when played
```

### Scenes

`SceneSelector`, `SceneEditor` and the `Scenes` list: see [Multicharacter Scenes](https://0bugscripts.gitbook.io/0bugscripts/multicharacter-v2/scenes).

### Translations

Every text is in `locales/<language>.lua`. Pick one with `Language`. To change a text, edit it in that file. To add a language, copy `en.lua`, rename it (e.g. `sv.lua`), change `Locales['en']` to `Locales['sv']` and translate it. Keep every `%s`: it is replaced by a number or a name. Any line you leave out is shown in English.
