> 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/infinity-scripts/battlepass/installation.md).

# Installation

📥 Installation Guide - FiveM BattlePass Script

### 1️⃣ Download & Extract Files

* Go to **Keymaster** and download:
  * 🟢 0bug-core
  * 🔵 0bug\_Battlepass
* Extract the downloaded files into your <mark style="color:orange;">**resources**</mark> folder.

### 2️⃣ Start the Resources in server.cfg

Open your <mark style="color:blue;">**server.cfg**</mark> and **ensure the resources start in the correct order**:

```
ensure qb-core        # If using QBCore
ensure es_extended    # If using ESX
ensure qbx_core       # If using QBox
ensure 0bug-core      # This must be started BEFORE the BattlePass script!
ensure 0bug_Battlepass
```

✅ **Note:** 0bug-core **must** be started **before** 0bug\_Battlepass, but **after** your framework (qb-core, es\_extended, or qbx\_core).

### 3️⃣ Configure 0bug-core

```lua
WIZ_CONFIG = {
    Framework = "QBCore", -- Change to your framework: QBCore, QBox, or ESX
    MySQL = "oxmysql",    -- Database system (oxmysql recommended)
    DefaultAvatar = "https://w0.peakpx.com/wallpaper/163/205/HD-wallpaper-street-fivem-gta-gta-v-roleplay.jpg", 
    Lang = "en", -- Change language: en, fr, es, de, etc.
    Logger = false -- Enable or disable logging
}
```

🔹 **Optional:** Change <mark style="color:orange;">DefaultAvatar</mark> to your **server logo URL**.

### 4️⃣ Make yourself Admin&#x20;

Add the following to your server.cfg.

```properties
add_ace group.admin 0bug_Battlepass.admin allow
```

Make sure you are added to the admin/god group

```properties
add_principal identifier.fivem:920222 group.admin               
```

### 🛒 Tebex Purchase Integration - BattlePass

To allow players to **buy the Premium BattlePass or BattlePass credits**, you need to **configure Tebex to execute in-game commands** when a purchase is made. Follow these steps:

### 🔹 Step 1: Set Tebex Commands in the BattlePass Config

Navigate to:\
📂 `resources/0bug_Battlepass/Customize.lua`

Ensure these two settings are properly configured:

```lua
Tebex_Credit_Readme_Code_Command = "purchase_credit",
Tebex_Premium_Readme_Code_Command = "purchase_premium"
```

These commands will be triggered when a player buys **Premium BattlePass** or **Credits** via Tebex.

### 🔹 Step 2: Create Tebex Packages

You need to create **two packages** on your **Tebex Webstore**:

1️⃣ **Premium BattlePass Package**\
2️⃣ **BattlePass Credit Package (Example: Buy 50 Credits)**

### 🔹 Step 3: Configure Tebex Deliverables

For each package, follow these instructions:

#### **1️⃣ Setting Up the Premium BattlePass Package**

1. **Go to your Tebex Control Panel**
2. **Create a new package** for the **Premium BattlePass**
3. **Set a price** (e.g., `$10 for Premium BattlePass`)
4. **Go to the&#x20;**<mark style="color:blue;">**“Package Settings”**</mark> tab
5. **Choose&#x20;**<mark style="color:orange;">**"Game Server Commands"**</mark>**&#x20;as the Deliverable Type**
6. Under <mark style="color:green;">**"Game Command"**</mark>, add the following command:

```ini
purchase_premium {transaction}
```

The <mark style="color:red;">{transaction}</mark> parameter will automatically be replaced with the transaction ID

<figure><img src="https://3424912082-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89arMlYkHza1FJDvW36X%2Fuploads%2F0IOfzwUooVB5RvODMnpP%2Fimage.png?alt=media&amp;token=c341070a-e1a6-4389-aaa5-caac534825dd" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3424912082-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89arMlYkHza1FJDvW36X%2Fuploads%2FRV6a3G9T0NJvsIxVUBrp%2Fimage.png?alt=media&amp;token=db8cef02-c03b-4f65-bcc4-ef379ff14d9b" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3424912082-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89arMlYkHza1FJDvW36X%2Fuploads%2FuJEyXAALlJowm6M0LL5Q%2Fimage.png?alt=media&amp;token=51e9e6d3-dd09-4eef-9f94-e3399976ef76" alt=""><figcaption></figcaption></figure>

3. When a player purchases a slot:
4. They will receive an email with the transaction ID&#x20;
5. They can enter that transaction id under the in-game menu&#x20;
6. They will unlock the premium items on the Battlepass

2️⃣ Setting Up the BattlePass Credit Package

* **Create a new package** for **BattlePass credits** (e.g., “Buy 50 BattlePass Credits”).
* **Set a price** (e.g., `$5 for 50 Credits`).
* **Go to the&#x20;**<mark style="color:blue;">**“Package Settings”**</mark> tab.
* **Choose&#x20;**<mark style="color:orange;">**"Game Server Commands"**</mark>**&#x20;as the Deliverable Type**.
* Under <mark style="color:green;">**"Game Command"**</mark> add the following command:

```
purchase_credit {transaction} 50
```

<figure><img src="https://3424912082-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89arMlYkHza1FJDvW36X%2Fuploads%2F5cAkAEOlDw16lDwguriV%2Fimage.png?alt=media&amp;token=65494de5-d084-499a-ae83-1e752cb48222" alt=""><figcaption></figcaption></figure>

✅ **This will give the player 50 credits after purchasing the package.**

💡 **Replace** <mark style="color:yellow;">`50`</mark> **with the number of credits you want to give for that package.**
