Custom Balance ATM

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Achterdochtig

Member
Sep 24, 2021
4
0
1
24
Hi im making a custom ATM for a minecraft FiveM server where you can deposit money and take money. My problem is at the deposit, the money has a custom lore (&cOfficieel Minetopia bankbiljet!). I dont get any error when i reload the skript but it doesnt work.

Code:
on inventory click:
    if inventory name is "&3Selecteer het rekeningtype:":
        if name of clicked item is "&cGeld storten":
            set {_a} to (number of all ghast tear in player's inventory * 5000)
            set {_b} to (number of all diamond in player's inventory * 2500)
            set {_c} to (number of all redstone in player's inventory * 1000)
            set {_d} to (number of all emerald in player's inventory * 500)
            set {_e} to (number of all coal in player's inventory * 250)
            set {_f} to (number of all iron ingot in player's inventory * 100)
            set {_g} to (number of all quartz in player's inventory * 50)
            set {_h} to (number of all gold ingot in player's inventory * 10)
            set {_i} to (number of all gold nugget in player's inventory * 1)
 
            remove all ghast tear from player's inventory
            remove all diamond from player's inventory
            remove all redstone from player's inventory
            remove all emerald from player's inventory
            remove all coal from player's inventory
            remove all iron ingot from player's inventory
            remove all quartz from player's inventory
            remove all gold ingot from player's inventory
            remove all gold nugget from player's inventory
 
            set {_totaal} to ({_a} + {_b} + {_c} + {_d} + {_e} + {_f} + {_g} + {_h} + {_i})
            add {_totaal} to player's balance
            send "&3➡ Je hebt {totaal} gestort op je rekening."
 
Three solutions… Try:

1)
Code:
amount of all ...

2)
Code:
set {_a} to ghast tear named "xx" with lore "xx"
...

add {_a}*5000 to {_total}
....

remove every {_a} from player's inventory

3) using loops
 
Status
Not open for further replies.