Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- command /shop:
- trigger:
- set metadata tag "shop" of player to chest inventory with 8 rows named "&aShop"
- set slot 0 of metadata tag "shop" of player to diamond sword named "&rDiamond Sword $500" with lore "&aClick to buy a Diamond Sword"
- set slot 1 of metadata tag "shop" of player to iron chestplate named "Iron Set $1000" with lore "&aClick to buy full Iron Armor Set"
- open (metadata tag "shop" of player) to player
- on inventory click:
- if event-inventory = (metadata tag "shop" of player):
- cancel event
- if index of event-slot is 0:
- if {money::%player%'s uuid} > 1000:
- give player 1 diamond sword
- remove 500 from {money::%player%'s uuid}
- send "&aSuccessfully bought a Diamond Sword!" to player
- else:
- send "&aYou're too poor!"
- if index of event-slot is 1:
- if {money::%player%'s uuid} > 1000:
- give player 1 iron helmet
- give player 1 iron chestplate
- give player 1 iron leggings
- give player 1 iron boots
- remove 1000 from {money::%player%'s uuid}
- send "&aSuccessfully bought Iron Set!" to player
- else:
- send "&aYou're too poor!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement