#Banknote Skript

1 messages · Page 1 of 1 (latest)

latent sinew
#
    permission: admin.createbanknote
    trigger:
        set {_amount} to argument 1
        set {_item} to paper named "<##65DB33>$%{_amount}%" with lore "&7Right click this banknote to receive your money."
        give {_item} to player
        send "&aYou got a banknote with $%{_amount}%!" to player

on rightclick holding paper:
    send "&eEvent triggered: Right click with paper!" to player
    set {_name} to name of event-item
    send "&eItem name: %{_name}%" to player
    if {_name} starts with "<##65DB33>$":
        replace all "<##65DB33>$" with "" in {_name}
        send "&eExtracted amount: %{_name}%" to player
        if {_name} is not a number:
            send "&cError: Unable to extract the amount from the banknote!" to player
            stop
        execute console command "/eco give %player% %{_name}%"
        send "&a<##65DB33>$%{_name}% has been added to your account!" to player
        remove 1 of event-item from player
    else:
        send "&cError: This paper is not a valid banknote!" to player```
uncut wind
#

name is a string

#

need to do {_x} parsed as number

latent sinew
#

uh

versed depot
#

also instead of a console command, just use player's balance (needs vault)

latent sinew
uncut wind
#

in the code

latent sinew
#

yes but wich line

uncut wind
#

where you need it

versed depot
#

actually thats not really a good analogy

#

more like we tell you whats in the fridge and you cook

latent sinew
latent sinew
#

i tried this now

#
    permission: admin.createbanknote
    trigger:
        set {_amount} to argument 1
        set {_item} to paper named "<##65DB33>$%{_amount}%" with lore "&7Right click this banknote to receive your money."
        give {_item} to player
        send "&aYou got a banknote with $%{_amount}%!" to player

on rightclick holding paper:
    send "&eEvent triggered: Right click with paper!" to player
    set {_name} to name of event-item
    send "&eItem name: %{_name}%" to player
    if {_name} starts with "<##65DB33>$":
        replace all "<##65DB33>$" with "" in {_name}
        send "&eExtracted amount: %{_name}%" to player
        set {_amount} to {_name} parsed as number
        if {_amount} is not a number:
            send "&cError: Unable to extract the amount from the banknote!" to player
            stop
        execute console command "/eco give %player% %{_amount}%"
        send "&a<##65DB33>$%{_amount}% has been added to your account!" to player
        remove 1 of event-item from player
    else:
        send "&cError: This paper is not a valid banknote!" to player```