How do I check the player's cash.

Gigabyte
03 Oct 2022, 00:26

I'm trying to make a vending machine but I can't check the player's money to make sure they have enough... anyone know what to do?


mrangel
03 Oct 2022, 00:39

I think you want to use the attribute game.pov.money.

For example:

If (game.pov.money >= 2) {
  msg ("You put ¤2 in the machine and a " + GetDisplayNameLink (CloneObjectAndMoveHere (banana), "object") + " comes out.")
  game.pov.money = game.pov.money - 2
}
else {
  msg ("You don't have ¤2 for the machine.")
}

(Off the top of my head)


Gigabyte
03 Oct 2022, 00:47

It worked thank you very much.