# OX Inventory

## Step 1: Find `ox_inventory/client.lua`

After opening client.lua with the help of Notepad++ or VSCode, find an empty space and paste the codes below.

```lua
rmThrow = function(weapon)
	if GetResourceState("rm_throw") and GetResourceState("rm_throw") == "started" then
		if weapon == "item" and exports["rm_throw"]:useItem() then
			return false
		end
		
		if weapon == GetHashKey("WEAPON_SNOWBALL") then
			return false
		end

		if exports["rm_throw"]:useItem() then
			return false
		end
	end

	if GetResourceState("rm_weaponv") and GetResourceState("rm_weaponv") == "started" then
		return weaponState
	end

	return true
end
```

## Step 2: Find `ox_inventory:setPlayerInventory` Event

You will find the code block below in the last parts of this event.

```lua
if currentWeapon then
	if weaponHash ~= currentWeapon.hash and currentWeapon.timer then
		local weaponCount = Items[currentWeapon.name]?.count

		if weaponCount > 0 then
			SetCurrentPedWeapon(playerPed, currentWeapon.hash, true)
			SetAmmoInClip(playerPed, currentWeapon.hash, currentWeapon.metadata.ammo)
			SetPedCurrentWeaponVisible(playerPed, true, false, false, false)

			weaponHash = GetSelectedPedWeapon(playerPed)
		end

		if weaponHash ~= currentWeapon.hash then
			currentWeapon = Weapon.Disarm(currentWeapon, true)
		end
	end
elseif client.weaponmismatch and not client.ignoreweapons[weaponHash] then
	local weaponType = GetWeapontypeGroup(weaponHash)

	if weaponType ~= 0 and weaponType ~= `GROUP_UNARMED` then
		Weapon.Disarm(currentWeapon, true)
	end
end
```

## Step 3: Replace the code block you found

Edit the code block in step 2 as follows.

```lua
if currentWeapon then
    if rmThrow(weaponHash) and weaponHash ~= currentWeapon.hash and currentWeapon.timer then
        local weaponCount = Items[currentWeapon.name]?.count

        if weaponCount > 0 then
            SetCurrentPedWeapon(playerPed, currentWeapon.hash, true)
            SetAmmoInClip(playerPed, currentWeapon.hash, currentWeapon.metadata.ammo)
            SetPedCurrentWeaponVisible(playerPed, true, false, false, false)

            weaponHash = GetSelectedPedWeapon(playerPed)
        end

        if rmThrow("item") and weaponHash ~= currentWeapon.hash then
            currentWeapon = Weapon.Disarm(currentWeapon, true)
        end
    end
elseif client.weaponmismatch and not client.ignoreweapons[weaponHash] then
    local weaponType = GetWeapontypeGroup(weaponHash)

    if weaponType ~= 0 and weaponType ~= `GROUP_UNARMED` and rmThrow("item") then
        Weapon.Disarm(currentWeapon, true)
    end
end
```

## Additional

If you cannot make this change correctly, you can download the file below and replace it with ox\_inventory/client.lua.

{% file src="/files/ZwYlRazqAlZCbKl5p6bV" %}


---

# 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://docs.rainmad.com/resources/throw-everything/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.
