No weapons

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.

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.

Blocking Open Inventory ( ox_inventory )

  • Open the client.lua file from ox_inventory.

  • Find the following line ( at the beginning of the code ) :

if IsPauseMenuActive() then return end

Just below this line, you will put this code:

if LocalPlayer.state.inRoyale then return end

stay the same as in this print.

Atualizado