deposit.show(player).then(result => {
const amount = result.formValues[0]
const toggle = result.formValues[1]
if (amount > getScore(player, 'gold')) {
player.tell("§cYou don't have that enough money!")
player.runCommandAsync("playsound note.bass @s")
} else if (amount <= getScore(player, 'gold')) {
player.runCommandAsync(`scoreboard players remove @s gold ${amount}`)
player.runCommandAsync(`scoreboard players add @s bank ${amount}`)
}
if (toggle == true && amount <= getScore(player, 'gold')) {
world.say(` §7${player.name} deposited $${amount}`)
player.runCommandAsync("playsound random.toast @s")
} else if (toggle == false && amount <= getScore(player, 'gold')) {
player.tell(` §7Transaction §2Completed!`)
player.runCommandAsync("playsound random.toast @s")
}
if (isNaN(amount)) {
player.tell("§cAmount cannot contain letters!")
player.runCommandAsync("playsound note.bass @s")
}
if (amount < 0) {
player.tell("Amount cannot contain negative values!")
player.runCommandAsync("playsound note.bass @s")
}
})```
The thing don't work is
```js
if (amount < 0) {}
I tried stopping the transaction after that error with return, it doesn't work