# OX\_INVENTORY

## STEP \[ 1 ] — Drop item feature

1. Open <mark style="color:yellow;">`ox_inventory/modules/inventory/server.lua`</mark>
2. Locate this Function <mark style="color:yellow;">local function dropItem(source, playerInventory, fromData, data)</mark>
3. Add the following line inside the item drop logic

{% code overflow="wrap" fullWidth="false" %}

```lua
if exports['sanba-realisticitemdrop']:sanbarealisticdrop(source, toData) then return end
```

{% endcode %}

Your code should look something like this

<figure><img src="/files/uNg41VrIf7gy4mnMWaR6" alt=""><figcaption></figcaption></figure>

## STEP \[ 2 ] — Give, throw and Place item feature

1. keep on  <mark style="color:yellow;">`ox_inventory/modules/inventory/server.lua`</mark>
2. Locate this Function <mark style="color:yellow;">local function giveItem(playerId, slot, target, count)</mark>
3. Add the following line inside the item give logic

{% code overflow="wrap" %}

```lua
if exports['sanba-realisticitemdrop']:Givethrow(source, fromInventory.items[slot], count) then return end

```

{% endcode %}

Your code should look something like this

<figure><img src="/files/nTWyPFyK5s5Ugitx3Yqe" alt=""><figcaption></figcaption></figure>

## STEP \[ 3 ]

1. open <mark style="color:yellow;">`ox_inventory/client.lua`</mark>&#x20;
2. Locate this NUI Callback <mark style="color:yellow;">RegisterNUICallback('giveItem', function(data, cb)</mark>
3. Replace the following line `if nearbyCount == 0 then return end` with the one bellow

{% code overflow="wrap" %}

```lua
if nearbyCount == 0 then giveItemToTarget(nil, data.slot, data.count) end
```

{% endcode %}

Your code should look something like this

<figure><img src="/files/NwPX0m5LvxyRWyyRmw8V" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sanbascripts.gitbook.io/bytestake/realistic-item-drop/installation/ox_inventory.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
