⚙️Configuration

1️⃣ Customize the BattlePass Settings

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

Modify the settings as needed:

Customize = {
    Lang = "en", -- Set language
    ItemImagePath = "nui://qb-inventory/html/images/", -- Path for inventory images
    Tebex_Credit_Readme_Code_Command = "purchase_credit", -- Command for purchasing credits
    Tebex_Premium_Readme_Code_Command = "purchase_premium" -- Command for purchasing premium pass
}

📌 Tip: Set ItemImagePath to match your inventory system (qb-inventory, ox_inventory, etc.).

2️⃣ UI & XP Settings

Configure UI and XP settings inside Customize.lua:

UI_Settings = {
    Open_Buy_More_Credits_Web_Site = "https://0bugscripts.tebex.io/", -- Tebex store link
    Buy_Level_Price = 5, -- Price per level
    Buy_Level_Price_Type = "credit",  -- Options: "credit", "cash", "bank"
    Total_XP = 500, -- XP required to complete the BattlePass
    Daily_Quiz_Award = "1000", -- XP reward for correct quiz answers
    Daily_Get_Spin_Credit = 1 -- Credits needed for extra spins
}

3️⃣ BattlePass Commands

Here are the available commands you can modify:

Commands like clearDailyData should be directly used from txadmin - Server side console.

How to use the commands for each framework :

When it comes to ESX, you need to use the player's license identifier, and make sure you remove the license: part but for QBCore/QBox you need to use the player's CitizenID . You can verify what identifier the script is considering for the player under the data/player.json file

4️⃣ Season & Daily Spin Settings

Manage BattlePass duration, daily resets, and spins in Customize.lua:

5️⃣ BattlePass Server Exports

💡 Getting Player Identifier

Before using these exports, you need to get the player's identifier for ESX and the player CitizenID for QBCore.

Example:

ESX

🎮 Player Data Functions

🔹 addLevel(identifier, amount)

Increases a player's level by a given amount.

Usage:


🔹 removeLevel(identifier, amount)

Decreases a player's level by a given amount.

Usage:


🔹 addXP(identifier, amount)

Adds XP to a player. If XP exceeds the max, it levels up the player.

Usage:


🔹 setPremium(identifier, value)

Sets a player's premium status (true or false).

Usage:


💰 Credit Functions

🔹 addCredit(identifier, amount)

Adds credits to a player.

Usage:


🔹 removeCredit(identifier, amount)

Removes credits from a player.

Usage:


🔹 getCredit(identifier)

Returns the player's current credit balance.

Usage:


🔄 Data Management Functions

🔹 clearPlayerData(identifier)

Clears all stored data for a specific player.

Usage:


🔹 clearPlayersData()

Clears all players' data.

Usage:


🔹 clearScriptData()

Resets all script-wide BattlePass data, including daily missions, spins, quizzes, and weekly missions.

Usage:


🔹 clearDailyData()

Resets only the daily script data such as daily missions, spins, quizzes, and tracked daily hours. Weekly data and reward codes remain untouched.

Usage:


🔹 clearWeeklyData()

Resets only the weekly script data, including weekly missions and weekly date tracker. Daily data and reward codes remain unchanged.

Usage :


📌 Notes

  • Use GetPlayerIdentifier(source, 0) to get the player's unique identifier.

  • Make sure 0bug_Battlepass is started before using these exports.

🎯 Configuring Missions, Quiz, & Rewards

✅ Editing Missions & Rewards

Navigate to: 📂 resources/0bug_Battlepass/config/

This folder contains JSON files for:

  • dailyMissionsList.json (Daily missions)

  • weeklyMissions.json (Weekly missions)

  • dailyQuizList.json (Daily quiz)

  • dailySpinList.json (Spin rewards)

  • freeProducts.json (Free rewards)

  • premiumProducts.json (Premium rewards)

📝 Adding a Daily or Weekly Mission

🔹 How it works:

  • title: Name of the mission.

  • description: What players need to do.

  • totalValue: How many times they must complete it.

  • trigger: The event that grants XP when triggered.

  • triggerAddXP: How much XP players earn for completing it.

How to implement the Mission in Other Scripts!

When adding support for daily and weekly missions, we need to ensure that both the client-side and server-side events are properly triggered.

🔄 Server-Side Integration

To make the mission work, add the event you did set in the config inside another script (e.g., when a player eats 🍔) :

📌 Client-Side Integration

📂 Modify your client-side script (e.g., consumables.lua) to add XP when a player drinks 💧

📚 Setting Up Daily Quiz Questions

Daily quiz questions are stored in: 📂 resources/0bug_Battlepass/config/dailyQuizList.json

Each question follows this structure:

🔹 Explanation

  • "1": Unique identifier for each quiz question.

  • "question": The question players will see.

  • "answers": A list of possible answers.

    • "title": The answer text.

    • "correct": Set to true for the correct answer, all others should be false.

🎁 Setting Up Free & Premium Rewards

BattlePass rewards are stored in: 📂 resources/0bug_Battlepass/config/freeProducts.json (for free rewards) 📂 resources/0bug_Battlepass/config/premiumProducts.json (for premium rewards)

Each reward follows this structure:

🔹 Explanation

  • "id": Unique identifier for the reward.

  • "type": Defines the type of reward.

  • "title": The display name for the reward.

  • "name": The database identifier of the item, vehicle, or currency.

  • "amount": The quantity of the reward.

  • "customImage" (optional): If you add a custom image, place the image in: 📂 resources/0bug_Battlepass/resources/image/

You can define the type with 5 different options :

  • "item" → A regular inventory item.

  • "illegalItem" → An illegal item.

  • "cash" → In-game money.

  • "car" → A vehicle reward.

  • "xp" → Experience points.

🎡 Setting Up Daily Spin Rewards

Daily Spin rewards are stored in: 📂 resources/0bug_Battlepass/config/dailySpinList.json

Each reward follows this structure:

🔹 Explanation

  • "id": Unique identifier for the reward.

  • "type": Defines the type of reward. Options:

    • "item" → A regular inventory item.

    • "illegalItem" → An illegal item.

    • "cash" → In-game money.

    • "car" → A vehicle reward.

    • "xp" → Experience points.

  • "title": Name of the reward displayed in the UI.

  • "name": The item, cash, or car identifier used in the database.

  • "probability": Chance (out of 100) to get this reward.

  • "amount": The quantity of the reward.

  • "customImage" (optional): If you add a custom image, place the image in: 📂 resources/0bug_Battlepass/resources/image/

Last updated