INFINITYCORE FRAMEWORK
  • Getting started Infinity Core
  • INTRODUCTION
    • Framework FAQ
    • The World Map
    • Onesync & Txadmin
    • Chat/Vocal & Discord
    • Multi-Characters
    • Moonshiners DLC Remake
    • Performances
    • Zombies Population (add-on)
  • Roleplay Functions
    • Player commands
    • Admin commands
  • Global Functions
    • Player Datas
    • Notifications
    • Economy & jobs
    • Inventory
    • Levels & XP (RPG)
    • Functions Core
    • Permissions
    • Discord Sync API
    • DEBUG TOOLS
  • CORE TEAM & CREDITS
    • Official Team
    • Credits
Powered by GitBook
On this page
  1. Global Functions

Inventory

All items are made in .json file, dont need SQL database

PreviousEconomy & jobsNextLevels & XP (RPG)

Last updated 1 month ago

Legend _InfinitySource = Source Player Quantity = Quantity sended or added PlayerDatas._Inventory = Inventory of player false/true = Show notification or not

INVENTORY
--  Add item in inventory
exports.undead_needs:AddInventoryItem(_InfinitySource, itemname, tonumber(quantity), playerDatasInventory, true)

--  Remove item from inventory
exports.infinity_core:RemoveInventoryItem(_InfinitySource, itemdb, tonumber(quantity), PlayerDatas._Inventory, false)

-- Use Item from inventory
exports.infinity_core:UseInventoryItem(_InfinitySource, itemname, PlayerDatas._Inventory)

-- Check player have item in inventory (return int or nil)
exports.infinity_core:CheckPlayerInventory(_InfinitySource, itemdb)
Example of made item
{
        "name"              : "WEAPON_MELEE_KNIFE_JAWBONE",
        "label"             : "Knife Jawbone",
        "description"       : "A best knife oh yeah!",
        "weight"            : 1.0,
        "type_item"         : "weapon",
        "for_item"          : "",
        "bonus"             : 0,
        "bonus2"            : 0,
        "bonus3"            : 0,
        "droped"            : 1,
        "rare"              : "common",
        "img"               : "items/weapon_melee_knife_jawbone.png"
 },

-- Category: drink, eat, ammo, ammo_clip, weapon, standard, health
-- Rare: common, rare, gold, legendary, mythic

-- In future updates a decay system is planned for eat
Inventory System with categories, rarity and more !