How to make points from a score be used to buy in-game stuff

So I was wondering, how could I make it so I can use points I get that go towards my score and make it work like money so I could allow my character to buy things from a shop or something. I want it to also subtract the score for however much the item was when my character buys something and then my character has the item to use. So how could I go about doing this? Make some variables and add some actions to them or what?

All help is appreciated, and thanks for taking the time to read this. :slight_smile:

Yeah, do global variable “Money” and add/remove from it.

BTW. Using score as money is a bad idea since highscores will be affected by how much player spends.

Exactly! :smiley:
As Darkhog said, you HAVE (there is no choice) to save the score in a variable, because the score changes over the time (it’s variable).

-Add a variable, for example “score”, and set it = 0 (or set it = the initial player’s score/money value).
-When the player satisfies a condition (kill an enemy, found an objct, etc.), add an amount to the variable “score”.
-When the player buy(?) something, substracts an amount from the variable “score”.

Darkhog: This system is a good idea if, finally, doesn’t exist a “highscore” (for example, a survival game, where the points only works to buy objects, upgrades, weapons and… survive). Anyway, highscore or no highscore, if you win with more points than another, it means you won with worse/inexpensive items, I think.

Thank you both again, I appreciate it. :slight_smile:

It really does help when you put the details on how to do these things.