Hi GiL,

I am trying to add Items to inventory in a script. The Item name is "Lesser Experience Potion" and the ID is 209. I want to add 5 Potions to the player, I have tried many different combinations, nothing seems to work.

I was trying something like this: ORK.Game.ActiveGroup.Leader.Inventory.Add(Item:209, 5, true, true); without success.

Can you please help me out here,
Thank you very much in advance,
SaVe
  • ORK.Game.ActiveGroup.Leader.Inventory.Add(new ItemShortcut(id, quantity), true, true, true);
    id is the ID/index of the item (in your case 209), quantity for your example 5. The rest are for showing a notification, console entry and marking the item as new content (e.g. if that's displayed in your menu screen).

    Depending on what kind of item you want to add, you need to use a different IShortcut imlementation, e.g. for a weapon or armor you'd use an EquipShortcut class.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thank you very much GiL, you rock :)
Sign In or Register to comment.