Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import:
- org.bukkit.event.inventory.InventoryClickEvent
- expression [event( |-)]([number ]key|hot[[ ]bar][ key])[ button]:
- return type: integer
- get:
- return event.getHotbarButton() + 1 if event.getHotbarButton() != -1
- return -1
- expression [event( |-)]([number ]key|hot[[ ]bar][ key])[ button]( |-)slot:
- return type: integer
- get:
- return event.getHotbarButton() if event.getHotbarButton() != -1
- return -1
- function compare(1: inventory, 2: inventory) :: boolean:
- return false if (name of {_1}) != (name of {_2})
- return false if (rows of {_1}) != (rows of {_2})
- return false if type of {_1} != type of {_2}
- return true
- on inventory close:
- delete {atmopen.%player%}
- command /atm:
- trigger:
- set {atmopen.%player%} to true
- set metadata tag "atm" of player to chest inventory with 4 rows named "&8Select an account type:"
- set slot 4 of (metadata tag "atm" of player) to skull of player named "&e&l%player%" with lore "&fPrivate acount: &l%balance of player%" and "Soon"
- set slot 20 of (metadata tag "atm" of player) to redstone block named "&4&l[!] &cComing Soon"
- set slot 22 of (metadata tag "atm" of player) to gold block named "&6&l[!] &ePrivate account"
- set slot 24 of (metadata tag "atm" of player) to diamond block named "&3&l[!] &bComing Soon"
- open (metadata tag "atm" of player) to player
- on inventory click:
- if {atmopen.%player%} is true:
- if compare(metadata tag "atm" of player, event-inventory) = true:
- cancel event
- if index of event-slot is 24:
- close player's inventory
- set action bar of player to "&c&l(!) &cComing soon! &7V{@Version}"
- else if index of event-slot is 20:
- close player's inventory
- set action bar of player to "&c&l(!) &cComing soon! &7V{@Version}"
- else if index of event-slot is 22:
- set metadata tag "pa" of player to chest inventory with 5 rows named "&8Total value: &6%balance of player%"
- set slot 13 of metadata tag "pa" of player to ghast tear named "€500" with lore "&f", "&e[Right Click] &7To Withdraw", "&e[Left Click] &7To deposit" and "&f"
- set slot 20 of metadata tag "pa" of player to diamond named "€200" with lore "&f", "&e[Right Click] &7To Withdraw", "&e[Left Click] &7To deposit" and "&f"
- set slot 21 of metadata tag "pa" of player to redstone dust named "€100" with lore "&f", "&e[Right Click] &7To Withdraw", "&e[Left Click] &7To deposit" and "&f"
- set slot 22 of metadata tag "pa" of player to emerald named "€50" with lore "&f", "&e[Right Click] &7To Withdraw", "&e[Left Click] &7To deposit" and "&f"
- set slot 23 of metadata tag "pa" of player to coal named "€20" with lore "&f", "&e[Right Click] &7To Withdraw", "&e[Left Click] &7To deposit" and "&f"
- set slot 24 of metadata tag "pa" of player to iron ingot named "€5" with lore "&f", "&e[Right Click] &7To Withdraw", "&e[Left Click] &7To deposit" and "&f"
- set slot 31 of metadata tag "pa" of player to gold ingot named "€1" with lore "&f", "&e[Right Click] &7To Withdraw", "&e[Left Click] &7To deposit" and "&f"
- open (metadata tag "pa" of player) to player
- wait 1 tick
- set {atmopen.%player%} to true
- else if compare(metadata tag "pa" of player, event-inventory) = true:
- cancel event
- if index of event-slot is 13:
- if click type is right mouse button:
- if balance of player >= 500:
- remove 500 from player's balance
- message "{@Prefix-ATM} &7You have successfully withdrawn &d€500 &7from your &dbank &7account."
- give player 1 of ghast tear named "€500" with lore "&f" and "&fofficial Ayra Banknote"
- else:
- close player's inventory
- send "{@Prefix-ATM} &7You don't have enough &dMoney &7to withdraw."
- else if click type is left mouse button:
- if player has ghast tear:
- remove 1 ghast tear from player
- add 500 to player's balance
- message "{@Prefix-ATM} &7You have successfully refunded &d€500 &7to your &dbank &7account."
- else:
- close player's inventory
- message "{@Prefix-ATM} &7You have no item of value &d€500 &7in your &dinventory&7."
- if index of event-slot is 20:
- if click type is right mouse button:
- if balance of player >= 200:
- remove 200 from player's balance
- send "{@Prefix-ATM} &7You have successfully withdrawn &d€200 &7from your &dbank &7account."
- give player 1 of diamond named "€200" with lore "&f" and "&fofficial Ayra Banknote"
- else:
- close player's inventory
- send "{@Prefix-ATM} &7You don't have enough &dMoney &7to withdraw."
- else if click type is left mouse button:
- if player has diamond:
- remove 1 diamond from player's inventory
- add 200 to player's balance
- send "{@Prefix-ATM} &7You have successfully refunded &d€200 &7to your &dbank &7account."
- else:
- close player's inventory
- send "{@Prefix-ATM} &7You have no item of value &d€200 &7in your &dinventory&7."
- if index of event-slot is 21:
- if click type is right mouse button:
- if balance of player >= 100:
- remove 100 from player's balance
- send "{@Prefix-ATM} &7You have successfully withdrawn &d€100 &7from your &dbank &7account."
- give player 1 of redstone dust named "€100" with lore "&f" and "&fofficial Ayra Banknote"
- else:
- close player's inventory
- send "{@Prefix-ATM} &7You don't have enough &dMoney &7to withdraw."
- else if click type is left mouse button:
- if player has redstone dust:
- remove 1 redstone dust from player's inventory
- add 100 to player's balance
- send "{@Prefix-ATM} &7You have successfully refunded &d€100 &7to your &dbank &7account."
- else:
- close player's inventory
- send "{@Prefix-ATM} &7You have no item of value &d€100 &7in your &dinventory&7."
- if index of event-slot is 22:
- if click type is right mouse button:
- if balance of player >= 50:
- remove 50 from player's balance
- send "{@Prefix-ATM} &7You have successfully withdrawn &d€50 &7from your &dbank &7account."
- give player 1 of emerald named "€50" with lore "&f" and "&fofficial Ayra Banknote"
- else:
- close player's inventory
- send "{@Prefix-ATM} &7You don't have enough &dMoney &7to withdraw."
- else if click type is left mouse button:
- if player has emerald:
- remove 1 emerald from player's inventory
- add 50 to player's balance
- send "{@Prefix-ATM} &7You have successfully refunded &d€50 &7to your &dbank &7account."
- else:
- close player's inventory
- send "{@Prefix-ATM} &7You have no item of value &d€50 &7in your &dinventory&7."
- if index of event-slot is 23:
- if click type is right mouse button:
- if balance of player >= 20:
- remove 20 from player's balance
- send "{@Prefix-ATM} &7You have successfully withdrawn &d€20 &7from your &dbank &7account."
- give player 1 of coal named "€20" with lore "&f" and "&fofficial Ayra Banknote"
- else:
- close player's inventory
- send "{@Prefix-ATM} &7You don't have enough &dMoney &7to withdraw."
- else if click type is left mouse button:
- if player has coal:
- remove 1 coal from player's inventory
- add 20 to player's balance
- send "{@Prefix-ATM} &7You have successfully refunded &d€20 &7to your &dbank &7account."
- else:
- close player's inventory
- send "{@Prefix-ATM} &7You have no item of value &d€20 &7in your &dinventory&7."
- if index of event-slot is 24:
- if click type is right mouse button:
- if balance of player >= 5:
- remove 5 from player's balance
- send "{@Prefix-ATM} &7You have successfully withdrawn &d€5 &7from your &dbank &7account."
- give player 1 of iron ingot named "€5" with lore "&f" and "&fofficial Ayra Banknote"
- else:
- close player's inventory
- send "{@Prefix-ATM} &7You don't have enough &dMoney &7to withdraw."
- else if click type is left mouse button:
- if player has iron ingot:
- remove 1 iron ingot from player's inventory
- add 5 to player's balance
- send "{@Prefix-ATM} &7You have successfully refunded &d€5 &7to your &dbank &7account."
- else:
- close player's inventory
- send "{@Prefix-ATM} &7You have no item of value &d€5 &7in your &dinventory&7."
- if index of event-slot is 31:
- if click type is right mouse button:
- if balance of player >= 1:
- remove 1 from player's balance
- send "{@Prefix-ATM} &7You have successfully withdrawn &d€1 &7from your &dbank &7account."
- give player 1 of gold ingot named "€1" with lore "&f" and "&fofficial Ayra Banknote"
- else:
- close player's inventory
- send "{@Prefix-ATM} &7You don't have enough &dMoney &7to withdraw."
- else if click type is left mouse button:
- if player has gold ingot:
- remove 1 gold ingot from player's inventory
- add 1 to player's balance
- send "{@Prefix-ATM} &7You have successfully refunded &d€1 &7to your &dbank &7account."
- else:
- close player's inventory
- send "{@Prefix-ATM} &7You have no item of value &d€1 &7in your &dinventory&7."
Advertisement
Add Comment
Please, Sign In to add comment