# No weapons

### &#x20;Preventing Weapon Disappearance in Battle Royale ( ox\_inventory integration )

If you're using the **ox\_inventory** script, you may notice that weapons disappear when entering the Battle Royale. To fix this issue, you'll need to make some modifications to the code.

1. Open the `client.lua` file from **ox\_inventory**.
2. Find the following line:

Copy

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

1. Just below this line, you'll see the following code:

   Copy

   ```
   if currentWeapon then
   ```

Change this line to:

Copy

```
if currentWeapon and not LocalPlayer.state.inRoyale then
```

This modification ensures that the script logic doesn’t apply while the player is inside the arena, preventing the weapon from disappearing.

Further down, find the following line:

Copy

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

Replace it with:

Copy

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

This additional change ensures that the weapon mismatch check is ignored when the player is inside the Battle Royale, helping prevent weapons from being removed unexpectedly.

Below is a printout of how you have to put it in your script.

<figure><img src="/files/9rIzRld2xdmnUyYzaA3J" alt=""><figcaption></figcaption></figure>

### &#x20;Other cases

If you don't use ox\_inventory you have to know how to identify on your server which script manages the player's weapons. And use the arena statebag which has examples here and also in reviver (ambulancejob) and a complete explanation on the ' Statebag ' page of how you use this function.

Also check if your server has anticheat and if this is the case, contact the owner of this script and explain the situation and they should definitely have a solution.

### &#x20;Blocking Open Inventory ( ox\_inventory )

* Open the `client.lua` file from **ox\_inventory**.
* Find the following line ( at the beginning of the code ) :

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

Just below this line, you will put this code:

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

stay the same as in this print.

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

<br>


---

# 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://energy-fivem.gitbook.io/energy-mlos/scripts/battle-royale/ox-inventory/no-weapons.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.
