How do I do that a variable couldn´t go under 0
Thanks a lot
If variable <0 set variable to 0.
but i want to use it to pay or so and if i do it on this way u can buy so much u want
how much you can buy... for zero euros?
if u have zero u can buy so much u want and than it is -100 or so and i want thaz u only can buy something if u have enough money u know?
No, I don't know. Can you rephrase that? I couldn't understand what you're trying to say.
i create a game where u can buy something with the coins from the game and if u have for example 10 coins and buy something for 100 coins u have -90 coins. now i want that u cant buy this if u have not enough money.
Just check if the cost is less than or equal to the amount of money before buying.
ex.
money >= cost
Develop games in your browser. Powerful, performant & highly capable.
....