How to adapt your script
How to Adapt Your Script
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.
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.
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"]:
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.
Wrong: item.metadata.myData
Correct: item.info.myData
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.
Wrong: item.count
Correct: item.amount
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:
Client Exports:
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