🛥️Client

Client Exports

OnPlayerLoad

Force the player's boot and inventory systems.

exports.origen_inventory:OnPlayerLoad()

Lock/Unlock Inventory

exports.origen_inventory:IsInventoryLocked() -- return boolean
exports.origen_inventory:LockInventory() -- return void
exports.origen_inventory:UnlockInventory() -- return void
exports.origen_inventory:ToggleInventoryAccess(lock --[[true/false]]) -- Lock / unlock inventory

ToggleHotBar

exports.origen_inventory:ToggleHotBar(visible --[[true/false]])

IsInventoryOpen

exports.origen_inventory:IsInventoryOpen() -- return boolean

openInventory

Open a giving inventory

--- Lower y upper cases are sensitives (openInventory not equal to old OpenInventory exports)
exports.origen_inventory:openInventory(invType, id, data?)
  • invType: string

    • 'player'

    • 'shop'

    • 'stash'

    • 'drop'

    • 'glovebox'

    • 'trunk'

  • id: number or string

  • data?: table

Examples

exports.origen_inventory:openInventory('player', 1)

GetInventory

Get Player inventory data

-- return table of items list
-- The following exports do exactly the same thing, for compatibility between various scripts.
exports.origen_inventory:GetInventory()
exports.origen_inventory:getPlayerInventory()
exports.origen_inventory:GetPlayerInventory()
--- Example
local myItems = exports.origen_inventory:GetInventory()
for slot, item in pairs(myItems) do
    if item.name == 'id_card' then
        ...
    end
end 

CloseInventory

Close player inventory

exports.origen_inventory:CloseInventory()

HasItem

Check if player has item

-- @return boolean
exports.origen_inventory:HasItem(item_name)

-- Example use
local hasWater --[[true/false]] = exports.origen_inventory:HasItem("water")
if hasWater then
    -- Do something
end

GetItems

Return the server item list or specific one

exports.origen_inventory:Items(item?)
exports.origen_inventory:GetInventoryItem(item?)
exports.origen_inventory:GetItemList(item?)
exports.origen_inventory:GetItems(item?)
exports.origen_inventory:getItems(item?)

Unarmed

Set player unarmed

exports.origen_inventory:Unarmed()

SetCurrentWeapon

exports.origen_inventory:SetCurrentWeapon(weapon_data, can_shoot)

-- Example usage
exports.origen_inventory:SetCurrentWeapon({
    name = "WEAPON_PISTOL"
    info = {
        attachments = {
            {
                component = "COMPONENT_PISTOL_CLIP_02" -- Component Hash or Name
            }
        },
        tint = 1
    }
}, true)

SetCurrentWeapon

exports.origen_inventory:AddAmmo(type, amount, item)

SetShopEnabled

It only works with stores you have in your configuration and not those created at runtime.

exports.origen_inventory:SetShopEnabled(shopId, enabled --[[true/false]])

Others

For either one, it will look for the closest player to execute the action.

Carry a near player

exports.origen_inventory:Carry()

PiggyBack near player

exports.origen_inventory:PiggyBack()

ToggleDriftMode

If driftmode is enabled you can toggle it with export

exports.origen_inventory:ToggleDriftMode(toggle--[[true/false]])

Last updated