Help with buying and upgrade system.

Hey guys, its been a long time since I have been consistently been on here, and that is because I was working on a huge project/game I thought would be cool, called Warheads: Ballistic (NO this is not an advertisement and YES it’s kid-friendly)

So basically I am trying to make a buying and upgrade system, where the player will go to their arsenal and press a button, opening a popup/menu. Now as the zapper is the starter weapon, they will already have it, and I already have a property checking if the player has the item.

What I am trying to do, is when the player buys an upgrade their current zapper, or whatever weapon they have, will be taken away and replaced with a new one. But to prevent any possible bugs/glitches or wasted money, I want to be able to check if the player already has an upgrade and is trying buy it again, they will get a message saying that they already bought the item, and the money spent will be given back to them.

I have tried using properties for every single upgrade, but I figured that would be to much memory usage, plus it was confusing. So please, helping would be deeply appreciated :grinning:.

Thank you!

1 Like

Hmmm debatable


Button pressed → open popup
Popup closed or primary clicked → grant item
The item granter grants -1 zappers
Then do the same again, and instead have it grant 1 of the gadget.

5 Likes

You can also just use a checker :slight_smile: (unless the property does something I don’t know about)

For the already bought item:
popup close (player now has item) → grant a color seed
Pop-up primary clicked or closed → check for color seed (using checker)
If fail → grant item like @Bardy_2913 said
If success → open another pop-up saying ‘you have already bought it’

You don’t actually need the seed - you could just change a property from 0 to 1 instead of granting the seed and then check for the property value equalling 1.

3 Likes

Put like vending machines, that usually solves everything. First when the player gets enough resources they buy the vending machine and then that triggers the next vending machine and it goes like that, make the thing that you get from the vending machine better and better each time

Only downside is the vending machines take a lot of memory and they want to use a popup of some sort