Installation

Installation

Welcome to the Bablo Throw Items installation guide! This guide will walk you through the complete installation process for our asset. By following each step carefully, you'll ensure a smooth and hassle-free setup, provided that all instructions are followed thoroughly.

Download asset

To find the asset, you must have made the purchase using your own cfx account. Otherwise, you can use the transfer system to move the asset to a different cfx account.

After purchasing from our official website (opens in a new tab), the asset will be delivered directly to your CFX Portal (opens in a new tab). From your panel, you can download the asset and proceed with the installation using the provided documentation.

Setup CFG

🚫

To ensure everything functions correctly when you're utilizing either the ESX, QBCORE or QBX framework instead of the standalone version, it's essential to adhere to the following steps carefully. Following these guidelines will help you achieve a seamless integration and maintain optimal performance across your systems.

When setting up your server environment, it is crucial to ensure that your core scripts are initialized before any additional resources. Specifically, the core resources such as es_extended, qb-core or qbx_core should be started first before you introduce other elements like the bablo-throwitems resource. This order is essential for maintaining a stable and functional environment.

-- First we will start the cores, never below
ensure es_extended or qb-core or qbx_core
ensure ox_lib
 
-- Start your inventory
ensure ox_inventory or qb-inventory
 
-- Start your target (optional, only if using target mode)
ensure ox_target or qb-target
 
-- Run bablo-throwitems here
ensure bablo-throwitems

Basic Configuration

Basic Framework Configuration

The asset will function automatically if your framework is named es_extended, qb-core or qbx_core, as it will detect either one when started. If your framework has been renamed, you can update its name in the config.lua file. Additionally, the asset supports standalone mode for users not utilizing a framework.

Inventory Configuration

The inventory is auto-detected. If you need to force a specific inventory, set Config.Inventory in config.lua to either ox_inventory or qb-inventory.

Target / Interaction Configuration

Ground item pickup interaction mode is set via Config.Interact in config.lua:

  • 'dui' (default) — DUI prompt with E key when nearby
  • 'target' — Uses your target system (ox_target, qb-target, etc.)

The target system is auto-detected. Set Config.Target manually if needed.

Inventory Setup

⚠️

Choose the tab that matches your inventory system. The setup for ox_inventory is simple — just add buttons to your items. The setup for qb-inventory is more advanced and requires editing multiple files.

ox_inventory Setup

With ox_inventory, adding throw and place functionality is straightforward. You simply add buttons to any item definition in your ox_inventory/data/items.lua file.

Adding Throw & Place Buttons

For every item you want to be throwable/placeable, add the buttons field to its entry in ox_inventory/data/items.lua:

['burger'] = {
    label = 'Burger',
    weight = 220,
    client = {
        status = { hunger = 200000 },
        anim = 'eating',
        prop = 'burger',
        usetime = 2500,
        notification = 'You ate a delicious burger'
    },
    buttons = {
        {
            label = 'Throw Item',
            action = function(slot)
                exports['bablo-throwitems']:throwItem(slot)
            end
        },
        {
            label = 'Place',
            action = function(slot)
                exports['bablo-throwitems']:placeItem(slot)
            end
        }
    },
},

What the buttons do

  • Throw Item — Calls exports['bablo-throwitems']:throwItem(slot) which enters throw mode. The player aims with RMB, throws with LMB, and can cancel with X. On landing, the item is removed from inventory and spawned as a ground item.
  • Place — Calls exports['bablo-throwitems']:placeItem(slot) which lets the player position the item on the ground in front of them with distance and rotation controls.

You can add these buttons to any item. Simply copy the buttons block into the item definition. No other files need to be modified — ox_inventory handles the custom buttons natively.

Full example (data/items.lua)

Here is an example showing the buttons added to a testburger item:

['testburger'] = {
    label = 'Test Burger',
    weight = 220,
    degrade = 60,
    client = {
        image = 'burger_chicken.png',
        status = { hunger = 200000 },
        anim = 'eating',
        prop = 'burger',
        usetime = 2500,
        export = 'ox_inventory_examples.testburger'
    },
    server = {
        export = 'ox_inventory_examples.testburger',
        test = 'what an amazingly delicious burger, amirite?'
    },
    buttons = {
        {
            label = 'Throw Item',
            action = function(slot)
                exports['bablo-throwitems']:throwItem(slot)
            end
        },
        {
            label = 'Place',
            action = function(slot)
                exports['bablo-throwitems']:placeItem(slot)
            end
        }
    },
    consume = 0.3
},

That's it for ox_inventory! No other files need to be changed.