Quick Help: Percentages

I've looked through the forums but im still struggling to figure this out. I just want my character to loose 100% of his money after being robbed. So if he has $5 and gets robbed he should have no money left. Im not able to use decrease money by 100% or 1.100 or whatever.

Please help guys.


Io

You multiply by a number. In the case of losing 100%, you multiply by 0. If he gains 150%, then multiply by 2.5 (150% plus the existing 100% you have) etc.


Thank You but i cant get it to work. What am i doing wrong?

DecreaseMoney (100 * 0) nor DecreaseMoney ( * 0)


Thank You but i cant get it to work. What am i doing wrong?

DecreaseMoney (100 * 0) nor DecreaseMoney ( * 0)


The IncreaseMoney and DecreaseMoney functions are just for adding or subtracting.

If you want someone to lose all of their money, it's easier just to set their money to zero. The command you want in this case is:

game.pov.money = 0

or

set (game.pov, "money", 0)

or you can use an expression to decrease their money by its current value (this is very silly):

DecreaseMoney (game.pov.money)

If you wanted someone to lose 23% of their money, for example, you'd multiply their money by that percentage:

DecreaseMoney (game.pov.money * 23/100)

(Note that where I've used game.pov, you can probably use player if you prefer. game.pov is just a special expression which finds the current player object even if you've changed its name to something other than "player")


Yes thank you. How did i not think of that?


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums