I guess you already have the item (ID) available in your code, since this is a custom UI.
With the item, you can get the item's price, remove the currency from the player's inventory and add the item: ItemShortcut item = new ItemShortcut(id, quantity); int price = item.BuyPrice(ORK.Game.ActiveGroup.Leader) * quantity; ORK.Game.ActiveGroup.Leader.Inventory.SubMoney(currencyID, price, true, true); ORK.Game.ActiveGroup.Leader.Inventory.Add(item, true, true, true); id is the ID/index of the item, quantity the quantity you want to purchase. currencyID is the ID/index of the currency.
Post edited by gamingislove on
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!
With the item, you can get the item's price, remove the currency from the player's inventory and add the item:
ItemShortcut item = new ItemShortcut(id, quantity);
int price = item.BuyPrice(ORK.Game.ActiveGroup.Leader) * quantity;
ORK.Game.ActiveGroup.Leader.Inventory.SubMoney(currencyID, price, true, true);
ORK.Game.ActiveGroup.Leader.Inventory.Add(item, true, true, true);
id is the ID/index of the item, quantity the quantity you want to purchase.
currencyID is the ID/index of the currency.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!