change player gold

This is my first post and my first game so I'm sure this is a very newbie question! :headshake:

I have an event where my player gets thrown in jail and in order to get out he must pay a fine. I'm good with setting it up as a constant

decrease when the player has over that amount of Gold (say 100), but I want the player to lose all his gold if he has less then that amount. I think I need to set up a variable in a conditional branch to decrease the player gold by x, where x is a variable that equals the players current amount of gold. But I have no idea how to go about doing this.

I hope that makes sense. I am very bad with the whole variable thing so please explain in as much simple detail as possible. Thanks in advance for any help you can give. I just can't get my head wrapped around this.
use this script call


$game_party.lose_gold($game_party.gold)
use control variable and set it to load gama data, then change the game data from map ID to the party's gold.
Thank you Andar worked perfect.

Engr. Adiktuzmiko thank you also, I'm sure it would have worked also but I haven't used scripts before so I am still trying to learn how. 🙂
It's not a full script, you're just gonna put it into the Script call event command on the last page of event commands as is. 🙂

Original thread: https://forums.rpgmakerweb.com/threads/change-player-gold.41462/