Genkora
Frog blast the vent core!
- Reaction score
- 92
I made a merchant that you can sell items to and other players can buy those items. Since there isn't a way of adding/removing items that a merchant can sell (to my knowledge), I made a closed off area connected to the merchant that buys the items, in which the sold item is put inside this closed off area. When a hero comes close to the merchant, it is given two abilities, Item Grabber and Price Checker. Price Checker tells you the price of the target item, item grabber buys it. When the hero leaves the region around the merchant, the abilities are removed. This all works fine.
Here is my problem. There is no way of finding the cost of an item through GUI (to my knowledge), so far I have been setting item health to be the same as the item's cost, and using that to calculate prices. When the items are put inside the closed off area, they are made invulnerable, and it probably isn't much of a problem, but does anyone know of a way of finding item cost through triggers?
One thing I have thought of is using a trigger to find how much gold someone has before selling and after selling, subtracting, and setting the difference to a variable. But I don't know how I would make this MUI in GUI, and it certainly would not be the most reliable way.
Here is my problem. There is no way of finding the cost of an item through GUI (to my knowledge), so far I have been setting item health to be the same as the item's cost, and using that to calculate prices. When the items are put inside the closed off area, they are made invulnerable, and it probably isn't much of a problem, but does anyone know of a way of finding item cost through triggers?
One thing I have thought of is using a trigger to find how much gold someone has before selling and after selling, subtracting, and setting the difference to a variable. But I don't know how I would make this MUI in GUI, and it certainly would not be the most reliable way.