# No weapons

## ❌ No Weapons — Arena PvP (ox\_inventory Integration)

### Preventing Weapon Disappearance Inside Arena

If you are using **ox\_inventory**, you may notice that weapons disappear or get removed when entering Arena PvP.

To fix this issue, you need to make small modifications to the ox\_inventory script so it respects the Arena statebag:

This ensures that inventory logic does **not interfere** while the player is inside Arena.

***

## 🛠 Step 1 — Edit ox\_inventory (client.lua)

1️⃣ Open: **ox\_inventory/client.lua**

***

2️⃣ Locate this line:

```lua
local weaponHash = GetSelectedPedWeapon(playerPed)
```

3️⃣ Just below it, you will find:

```lua
if currentWeapon then
```

Replace it with:

```lua
if currentWeapon and not LocalPlayer.state.inArena then
```

This prevents ox\_inventory from interfering with weapons while the player is inside Arena PvP.

## 🛠 Step 2 — Prevent Weapon Mismatch Removal

Scroll further down and find:

```lua
elseif client.weaponmismatch and not client.ignoreweapons[weaponHash]
```

Replace it with:

```lua
elseif client.weaponmismatch and not client.ignoreweapons[weaponHash] and not LocalPlayer.state.inArena then
```

This ensures weapon mismatch checks are ignored while the player is inside Arena.

<figure><img src="https://3165241027-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9c0Pe86hIb7L19e6P9Dk%2Fuploads%2FZKvvJc4DFskb8ygfSdo7%2Fimage.png?alt=media&#x26;token=fb59f1b8-bd19-458c-bbc2-264570e7ea95" alt=""><figcaption></figcaption></figure>

## 🛠 Step 3 — Block Inventory Open Inside Arena

To prevent players from opening inventory while inside Arena:

Find this line (near the top of the file):

```lua
if IsPauseMenuActive() then return end
```

Add this directly below it:

```lua
if LocalPlayer.state.inArena then return end
```

<figure><img src="https://3165241027-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9c0Pe86hIb7L19e6P9Dk%2Fuploads%2FBxqQCEudblpXYIt7XBIu%2Fimage.png?alt=media&#x26;token=d9b84715-6d44-476c-93bd-615a67bfbffb" alt=""><figcaption></figcaption></figure>

## 🧩 Other Cases

If you are **not using ox\_inventory**, you need to:

1. Identify which script manages weapon saving on your server.
2. Add a check using:

```
if LocalPlayer.state.inArena then
    return
end
```

Anywhere weapons are:

* Saved
* Restored
* Synced
* Loaded on reconnect

***

## 🔐 Using Anti-Cheat

If your server uses an anti-cheat:

* Contact the anti-cheat developer.
* Inform them that Arena PvP uses `LocalPlayer.state.inArena`.
* Ask them to whitelist weapon changes while the statebag is `true`.
