Category:Inventory

From Nutscript Developer Wiki
Jump to navigation Jump to search

Summary[edit]

Inventory Class is tied to the Character Class not Player Class. Inventory Class has Slot Table, Inventory ID, and width and height.

Development Tips[edit]

How to search Inventory[edit]

Common Mistakes[edit]

Many people usually do this mistake.

Player:getInv()

This is not how you get the Inventory Class of the player. To get Inventory Class, You need to get the Character Class in order to get Inventory Class.

local char = Player:getChar()

After that, You need to confirm that the character is exists.

if (!char) then return end

Now You have access to the Character Class. Let's get the Inventory Class.

local inv = char:getInv()