Hey guys, so I have been working on an inventory system, and I have the basics down, except when trying to add an item, I want to use a function that uses these basic commands:
on function "additem"
pick "inventory" equal to parameter(pickedinventory)
and continue only if the parameter(addquant) > 0
if the parameter(xindex) < pickedinventory.width
inventory.at(parameter(xindex) = parameter(additemid)
inventory.at(parameter(xindex) , 1) < maximum stack size
- add to inventory slot amount by 1
- call the "additem" function, this time
with -1 "addamount"
else
-call the "additem" function, this time add 1 to xindex slot
else
-call the "additem" function, this time add 1 to xindex slot
else
-create a new stack at the inventory.indexof("none")
I have used this code and it does not work. is there any logic problems with it? The preview keeps crashing every time I try to add and item thats over its maximum stack size.