no script is needed here, just do with events and variables:
original by moder algebra modern algebra II (just fixed a few bugs)
@>Loop
@>Text: \GHow much would you like to deposit?
@>Input Number [XXX: Transaction Amount], 4 digits
@> Control Variables: [YYY: Party Gold] = Gold
@>Conditional Branch: Variable [XXX] <= Variable [YYY]
@>Break Loop
@>
: Branch END
@>Text: You do not have enough \v[XXX] Gold
@>Show Choices: Let me try again..., Forget it
: When [Let me try again...]
@>
: When [Forget it]
@>Exit Event Processing
: Branch End
:Repeat Above
@>Control Variables: [ZZZ: Money in Bank] += Variable [XXX: Transaction Amount]
@>change gold:-[xxx:transaction amount]
@>Text: You now have \v[ZZZ] in the bank! Please come again
this is for deposit but it is like the same for withdraw