#/withdraw

1 messages · Page 1 of 1 (latest)

grizzled cairn
#

honestly some parts of this look like AI code

cedar fable
#

nah

#

just stole it

#

uhm oops

grizzled cairn
#

thats still not making it lol

cedar fable
#

yeah ik

#

one sec

grizzled cairn
#

and whoever you stole it from used AI

cedar fable
#

I stole this skript but it doesnt work

` command /withdraw <number>:
trigger:
set {_amount} to arg-1
if {_amount} is not a number:
send "&cInvalid amount!" to player
stop
if {_amount} < 1:
send "&cYou must withdraw at least $1!" to player
stop
set {_balance} to player's balance # Get real balance using Vault
if {_amount} > {_balance}:
send "&cYou don't have enough money!" to player
stop
remove {_amount} from player's balance # Correct Vault usage to remove money
give player a paper named "&a$%{_amount}% Bill"
send "&aYou withdrew $%{_amount}%!" to player

on right click:
if player's tool is a paper:
set {_name} to name of player's tool
replace "&a$" with "" in {_name} # Remove color code and $
replace " Bill" with "" in {_name} # Remove the word 'Bill'

    if {_name} is a number:
        set {_amount} to {_name} parsed as number
        add {_amount} to player's balance  # Using Vault to add balance
        remove 1 of player's tool from player's inventory
        send "&aYou redeemed $%{_amount}%!" to player
    else:
        send "&cThis bill is invalid!" to player `
cedar fable
#

but do you know the correct way to do it?

grizzled cairn