Advertisement
Guest User

t

a guest
Feb 20th, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. on place:
  2. if player's held item contains "Backpack":
  3. cancel event
  4.  
  5. on rightclick:
  6. if player's held item contains "Backpack":
  7. make player execute command "/sell"
  8. else if lore of player's held item contains "Click to redeem your kits !":
  9. if player's gamemode is not creative or Spectator:
  10. remove 1 of player's held item from player's inventory
  11. give 1 of diamond pickaxe of efficiency 100 with no nbt named "&3&lStarter Pickaxe" lored "&7Fortune 10" to player
  12. give 1 of ender chest of unbreaking 10 with no nbt named "&b&lBackpack" lored "&7Right-Click to open Sell Menu !" to player
  13.  
  14. command /sell [<text>]:
  15. trigger:
  16. set {_stonev} to {Stone::%player%} * 10
  17. set {_coalv} to {Coal::%player%} * 15
  18. set {_ironv} to {Iron::%player%} * 20
  19. set {_goldv} to {Gold::%player%} * 25
  20. set {_lapisv} to {Lapis::%player%} * 30
  21. set {_redstonev} to {Redstone::%player%} * 35
  22. set {_diamondv} to {Diamond::%player%} * 40
  23. set {_emeraldv} to {Emerald::%player%} * 45
  24. set {_quartzv} to {Quartz::%player%} * 50
  25. set {_value} to {_stonev} + {_coalv} + {_ironv} + {_goldv} + {_lapisv} + {_redstonev} + {_diamondv} + {_emeraldv} + {_quartzv}
  26. set {_value} to round({_value} * 1)
  27. set {_value1} to split("%{_value}%")
  28. open virtual chest inventory named "&b&lBackpack Storage" with size 5 to player
  29. 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
  30. format gui slot 4 of player with ender chest named "&b&lYour Backpack" lored "&7Value: &a$%{_value1}%" to run player command "/sellall"
  31.  
  32. command /sellall:
  33. trigger:
  34. if {Stone::%player%} + {Iron::%player%} + {Gold::%player%} + {Lapis::%player%} + {Redstone::%player%} + {Diamond::%player%} + {Emerald::%player%} + {Quartz::%player%} > 0:
  35. 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%}
  36. add {_value} to player's balance
  37. set {_value1} to split("%{_value}%")
  38. send " &2&l&o* &a&lSell Summary &2&l&o*"
  39. send "&aYou &7sold your Items for &a$%{_value1}% &7!"
  40. else:
  41. send "&7[&c&lSELL&7] &cYou need to break Items before Selling !"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement