How to adapt your script

How to Adapt Your Script

  1. Identify Your Inventory Dependency: Check if your script currently supports either qb-inventory or ox-inventory. These scripts generally include export statements that reference one of these inventories.

  2. Copy the file Choose the export code from either qb-inventory or ox-inventory that your script uses. This will be the basis for your adaptation.

  3. Replace the Inventory Name: Change the export name to point to tgiann-inventory. For example:

-- Replace:
exports["qb-inventory"]: 
-- with:
exports["tgiann-inventory"]:

-- Replace:
exports.ox_inventory:
-- with:
exports["tgiann-inventory"]:
  1. metadata data

    Metadata data is stored as info in the inventory, just like in QB. When you retrieve data for an item, the data comes as info rather than metadata.

    1. Wrong: item.metadata.myData

    2. Correct: item.info.myData

  2. count data

    Count data is stored as amount in the inventory, just like in QB. When you retrieve data for an item, the data comes as info rather than metadata.

    1. Wrong: item.count

    2. Correct: item.amount

  3. Test the Modified Script: After making the changes, test your script thoroughly to ensure that all inventory-related functions are working as expected with tgiann-inventory.

Additional Resources

For more detailed information about the available exports, please refer to the following links:

  • Server Exports:

Server
  • Client Exports:

Client

By following these steps, you can quickly adapt scripts that are not natively compatible with tgiann-inventory, ensuring they work seamlessly within your inventory system.

Last updated