# QBCore Compatible

To ensure your script works seamlessly with the inventory system, you need to integrate the `QBCore:OnRemoveInventoryItem` triggers into your player.lua file. Follow the steps below to complete this process:

## **Step 1: Locate the Triggers in Our `player.lua`**

* **Download Our `player.lua`:**
  * Download our `player.lua` file, which contains the necessary triggers for removing inventory items.

{% file src="<https://3946157545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa5Ce4DSFKExllozwopRT%2Fuploads%2FhTlZ05WylWhVc1BnUWvL%2Fplayer.lua?alt=media&token=57e3d088-6e1a-4d17-852c-c07394893ff7>" %}

* **Search for `QBCore:OnRemoveInventoryItem`:**
  * Open our `player.lua` file using a text editor (such as VSCode or Notepad++).
  * Use the search function (usually `Ctrl + F`) to find all instances of `QBCore:OnRemoveInventoryItem`.
  * Review the code to identify how the triggers are used.

## **Step 2: Add the Triggers to Your `player.lua`**

* **Copy the Triggers:**
  * Copy the triggers related to `QBCore:OnRemoveInventoryItem` from our `player.lua` file.
* **Paste into Your `player.lua`:**
  * Open your own `player.lua` file in a text editor.
  * Paste the copied triggers into the appropriate locations within your file. Make sure they align with the logic of your existing code.

## **Step 3: If Using `qb_inventory`, Integrate on the Server Side**

* **Add Triggers to Server Side Functions:**
  * If you are using `qb_inventory`, the triggers may need to be added to server-side functions instead of the `player.lua`.
  * Identify the relevant server-side function in your `qb_inventory` scripts where items are removed or manipulated.
  * Paste the `QBCore:OnRemoveInventoryItem` triggers into the correct locations within the server-side function.
* **Test Your Setup:**
  * After integrating the triggers, save your changes and restart your server.
  * Test the functionality by removing inventory items in-game to ensure that the triggers work as expected.

***

By following these steps, you'll ensure that the `QBCore:OnRemoveInventoryItem` triggers are properly integrated into your system, maintaining smooth inventory management and avoiding potential issues.
