This repository has been archived on 2025-03-23. You can view files and clone it, but cannot push or open issues or pull requests.
spaceinator/scripts/add_item_to_inventory.gml
2020-07-29 11:29:00 +12:00

21 lines
420 B
Text

///add_item_to_inventory(itemId)
var itemId = argument0;
for(var i = 0; i < (9*4); i ++)
{
var itm = obj_inv_controller.inventory[i];
if(itm == 0)
{
obj_inv_controller.inventory[i] = itemId;
obj_inv_controller.inventoryCount[i] = 1;
return true;
}
else if(itm == itemId)
{
obj_inv_controller.inventoryCount[i] ++;
return true;
}
}
return false;