> For the complete documentation index, see [llms.txt](https://docs.rainmad.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rainmad.com/resources/weapon-v-realism/ox-inventory.md).

# OX Inventory

If you use ox inventory, you can learn how to harmonize your inventory in this explanation.

## 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
local weaponState = true

exports("rm_weapon", function(state)
    weaponState = state
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 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 weaponState 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` 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/TToYDk9tztRnfzYWjx6U" %}

{% hint style="warning" %}
If you are using the Throw Everything script, download the other file below.
{% endhint %}

{% file src="/files/5pXbGCyUbuOjxcFFIfJw" %}
