Bruno Scripts Docs
Bruno Scripts Docs
  • 👋About Us
  • 💶Tebex Store
  • 🔌DEPENDENCIES
    • 🖥️ LIB
      • Supported Inventories
      • Config File
  • 💶PAID SCRIPTS
    • 📜Insurance
      • Config File
    • 🧑‍🔧Mechanic
      • Config File
    • 📍Blips
      • Config File
    • 🎒Uniform Bag
      • Config File
    • ⛏️Mining
      • Config File
  • 💻FREE SCRIPTS
    • 📸Showroom
      • Config File
    • 🌊Water Cooler
      • Config File
Powered by GitBook
On this page
  • English
  • Integrated Inventories
  • Template
  • Português
  • Inventários Integrados
  • Template
  1. DEPENDENCIES
  2. 🖥️ LIB

Supported Inventories

🌟 Our amazing LIB!

Previous🖥️ LIBNextConfig File

Last updated 4 months ago

English

Integrated Inventories

At the moment, the following inventories are integrated into bs-lib:

  • ;

  • ;

  • ;

  • ;

Since the inventory functions are Open-Source, anyone can make any script compatible by implementing it themselves!

Template

local found = GetResourceState('your_inventory')
if found ~= 'started' and found ~= 'starting' then return end

BS.inventory = {}

function BS.inventory.hasItem(item)
    local inventory = exports['your_inventory']:getUserInventory()
    for _, invItem in pairs(inventory) do
        if invItem.name == item and invItem.count > 0 then
            return true
        end
    end
    return false
end
local found = GetResourceState('your_inventory')
if found ~= 'started' and found ~= 'starting' then return end

BS.inventory = {}

function BS.inventory.getItemSlot(source, itemName)
    return GetItemSlot(source, itemName) or false
end

function BS.inventory.getItemSlots(source, itemName)
    local src = source
    local items = exports['codem-inventory']:GetItemsByName(src, itemName)
    return GetSlotsByItem(items, itemName)
end

function BS.inventory.getItemMetadata(source, slot)
    local player = BS.getPlayer(source)
    if not player then return end
    return exports['your_inventory']:GetItemBySlot(source, slot).info
end

function BS.inventory.setItemMetadata(source, slot, metadata)
    if not slot then return false end
    if not metadata then metadata = {} end

    exports['your_inventory']:SetItemMetadata(source, slot, metadata)
end

Português

Inventários Integrados

De momento estão integrados na bs-lib os seguintes inventários:

Uma vez que as funções dos inventários são Open-Source, qualquer um poderá tornar compatível qualquer script fazendo tal implementação por sua conta!

Template

local found = GetResourceState('your_inventory')
if found ~= 'started' and found ~= 'starting' then return end

BS.inventory = {}

function BS.inventory.hasItem(item)
    local inventory = exports['your_inventory']:getUserInventory()
    for _, invItem in pairs(inventory) do
        if invItem.name == item and invItem.count > 0 then
            return true
        end
    end
    return false
end
local found = GetResourceState('your_inventory')
if found ~= 'started' and found ~= 'starting' then return end

BS.inventory = {}

function BS.inventory.getItemSlot(source, itemName)
    return GetItemSlot(source, itemName) or false
end

function BS.inventory.getItemSlots(source, itemName)
    local src = source
    local items = exports['codem-inventory']:GetItemsByName(src, itemName)
    return GetSlotsByItem(items, itemName)
end

function BS.inventory.getItemMetadata(source, slot)
    local player = BS.getPlayer(source)
    if not player then return end
    return exports['your_inventory']:GetItemBySlot(source, slot).info
end

function BS.inventory.setItemMetadata(source, slot, metadata)
    if not slot then return false end
    if not metadata then metadata = {} end

    exports['your_inventory']:SetItemMetadata(source, slot, metadata)
end

;

;

;

;

;

🔌
codem-inventory
ox_inventory
qb-inventory
qs-inventory
codem-inventory
ox_inventory
ps-inventory
qb-inventory
qs-inventory