Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on place:
- if player's held item contains "Backpack":
- cancel event
- on rightclick:
- if player's held item contains "Backpack":
- make player execute command "/sell"
- else if lore of player's held item contains "Click to redeem your kits !":
- if player's gamemode is not creative or Spectator:
- remove 1 of player's held item from player's inventory
- give 1 of diamond pickaxe of efficiency 100 with no nbt named "&3&lStarter Pickaxe" lored "&7Fortune 10" to player
- give 1 of ender chest of unbreaking 10 with no nbt named "&b&lBackpack" lored "&7Right-Click to open Sell Menu !" to player
- command /sell [<text>]:
- trigger:
- set {_stonev} to {Stone::%player%} * 10
- set {_coalv} to {Coal::%player%} * 15
- set {_ironv} to {Iron::%player%} * 20
- set {_goldv} to {Gold::%player%} * 25
- set {_lapisv} to {Lapis::%player%} * 30
- set {_redstonev} to {Redstone::%player%} * 35
- set {_diamondv} to {Diamond::%player%} * 40
- set {_emeraldv} to {Emerald::%player%} * 45
- set {_quartzv} to {Quartz::%player%} * 50
- set {_value} to {_stonev} + {_coalv} + {_ironv} + {_goldv} + {_lapisv} + {_redstonev} + {_diamondv} + {_emeraldv} + {_quartzv}
- set {_value} to round({_value} * 1)
- set {_value1} to split("%{_value}%")
- open virtual chest inventory named "&b&lBackpack Storage" with size 5 to player
- format gui slot 0 and 1 and 2 and 3 and 5 and 6 and 7 and 8 and 36 and 37 and 38 and 39 and 40 and 41 and 42 and 43 and 44 of player with white glass pane named "" to do Nothing
- format gui slot 4 of player with ender chest named "&b&lYour Backpack" lored "&7Value: &a$%{_value1}%" to run player command "/sellall"
- command /sellall:
- trigger:
- if {Stone::%player%} + {Iron::%player%} + {Gold::%player%} + {Lapis::%player%} + {Redstone::%player%} + {Diamond::%player%} + {Emerald::%player%} + {Quartz::%player%} > 0:
- set {_value} to (({Stone::%player%} * 10) + ({Coal::%player%} * 15) + ({Iron::%player%} * 20) + ({Gold::%player%} * 25) + ({Lapis::%player%} * 30) + ({Redstone::%player%} * 35) + ({Diamond::%player%} * 40) + ({Emerald::%player%} * 45) + ({Quartz::%player%} * 50)) * {Multi::%player%}
- add {_value} to player's balance
- set {_value1} to split("%{_value}%")
- send " &2&l&o* &a&lSell Summary &2&l&o*"
- send "&aYou &7sold your Items for &a$%{_value1}% &7!"
- else:
- send "&7[&c&lSELL&7] &cYou need to break Items before Selling !"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement