Instructions/Get space for item

From Desynced Wiki


Get space for item
     
     Returns how many of the input item can fit in the inventory
Lua ID getfreespace
Category Math
Icon Count Free Space.png
Argument One: Type Input
Argument One: Name Item
Argument One: Description Item to check can fit
Argument One: Data Type item
Argument Two: Type Output
Argument Two: Name Result
Argument Two: Description Number of a specific item that can fit on a unit
Argument Three: Type Input
Argument Three: Name Unit
Argument Three: Description The unit to check (if not self)
Argument Three: Data Type entity



Description[edit | edit source]

Gets the quantity of how many a specified item could fit inside an entity. Returns the specified item along with a number, which can be 0 or greater.

Uses[edit | edit source]

Used to evaluate how many of an item can fit inside self(default) or if specified, another entity's inventory.

An advantage over Check space for item is that you can evaluate against the inventory of another entity.

Similar Instructions[edit | edit source]

Check space for item