JG Protected Inventory for ox inventory

JG Protected Inventory

A simeple resource for ox inventory for a personal protected inventory, Player can access the protected inventory with a keybind and you can restrict which items they can store in there protected inventory

PREVIEW
DOWNLOAD

CHECKOUT MY TEBEX
TEBEX

OTHER RESOURCES
Afterlife IV Multicharacter
Afterlife IV SpawnMenu
Afterlife IV Hud 2.0
AfterLife Scoreboard
Afterlife Minimal Hud
Afterlife Inventory Radial

7 Likes

good work

2 Likes

pushing j key nothing popping up and have it set to esx

if you restart the script you will have to relog or logout

i fixxed it u had some mistakes in the code cuzz it was throwing the qb core export other then if i changed it to elseif

can you post the fixed version here?

if Config.framework == ‘esx’ then
ESX = exports[“es_extended”]:getSharedObject()
RegisterNetEvent(‘esx:playerLoaded’, function(player, xPlayer, isNew)
local id = xPlayer.getIdentifier() … ’ protectinventory’
exports.ox_inventory:RegisterStash(id, ‘Protected Inventory’, Config.slots, Config.maxweight * 1000)
GlobalState.inventoryid = id
end)
elseif Config.framework == ‘qb’ then
QBCore = exports[‘qb-core’]:GetCoreObject()
AddEventHandler(‘onServerResourceStart’, function(resourceName)
while (not QBCore.Functions.GetPlayerData()) do
local id = QBCore.Functions.GetPlayerData().citizenid … ’ protectinventory’
exports.ox_inventory:RegisterStash(id, ‘Protected Inventory’, Config.slots, Config.maxweight * 1000)
GlobalState.inventoryid = id
end
end)

end

I was skimming through the code, it seems that you are overwriting the same GlobalState.inventoryid for every player that joins. So from what it looks like, every player will share the inventory of the latest connected player

oh shit i did not realize that

can you fix it?

it is fixed you can check

ty
. …

it just opens the regular inventory now

idk i didnt try

it works now

[script:JG_ProtectInv] SCRIPT ERROR: ox_lib must be started before this resource.
[script:JG_ProtectInv] > fn (@ox_lib/init.lua:23)
[script:JG_ProtectInv] SCRIPT ERROR: @JG_ProtectInventory/main.lua:5: No such export registerHook in resource ox_inventory

Im getting this error
did not modified anything, using esx and ox inventory

you need to ensure it at the end of all the resources