Take half my gold?

I'm feeling dumber and dumber the more I dig into this. Can I simply take away half of player's gold?

The change gold option only lets me take away a fixed amount or a variable, so I'm forced to actually set up a variable which is equal to current gold, then use control variables again to count half of this value and finally change gold option to decrease the gold by half of gold, but that just seems completely overcomplicated.

There must be an easier way, right?
Afraid not. The easiest way I know of is to do a set variable command and store the player's gold in there, then do another set variable command to divide the current value in the previous variable (the one you stored the player's gold in) by 2, then do a decrease gold by that amount.
Use this script command:

$gameParty._gold /= 2
@Poryg does that mean $gameParty._gold *= 0 would bring your gold to zero?
@just1witness Spot on.
cool
@Poryg that's a neat little trick!

However, I'm guessing this way I can't tell the player "You just lost xG" - to do that, I still need to use the variable method?
Actually no. Since you're dividing the gold in half you would only need to show normal gold since it's the amount you have would be the same as the amount you lost in this case.
@Darktheron I thought about it, but:
1) it's pretty much a hack and I dislike those
2) If you have 5 gold, the "half" amount will be rounded up or down - either way, if you display your current gold as the amount you lost, the numbers will be different.
I completely forgot about that 😀

If you want it to round down, use this script.
$gameParty._gold = Math.floor ($gameParty._gold / 2)
If you want it to round up, use this script.
$gameParty._gold = Math.ceil ($gameParty._gold / 2)

As for the message, you can always use "You lost half of your gold! XY remaining!"

Original thread: https://forums.rpgmakerweb.com/threads/take-half-my-gold.82332/