Advertisement
twogz

Untitled

Jul 22nd, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.12 KB | None | 0 0
  1. command /sell [<text>]:
  2. trigger:
  3. if arg 1 is not set:
  4. open chest with 5 rows named "Sell your items..." to player
  5.  
  6. wait 0.6 ticks
  7.  
  8. format slot 0 of player with book named "&e&l%player%'s balance" with lore "&fMoney &a%player's balance%" to be unstealable
  9.  
  10. format slot 10 of player with coal ore named "&e&lCoal Ore" with lore "&r ||&fPrice &a$0.15 each||&r ||&6&lClick &fto sell all your coal ore." to run [player command "/sell coalore"]
  11. if arg 1 is "coalore":
  12. if player has coal ore:
  13. while amount of coal ore in player's inventory is bigger than 0:
  14. add 1 to {_amount.%player%}
  15. remove 1 coal ore from player's inventory
  16. add 0.15 to {_payout.%player%}
  17. message ""
  18. message " &e&lSold %{_amount.%player%}% Items:"
  19. message ""
  20. message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
  21. message "&7 and received &a$%{_payout.%player%}% &7in total."
  22. message ""
  23. add {_payout.%player%} to player's balance
  24. stop
  25. else:
  26. message "&c&lHey! &7You don't have enough of this item to sell it."
  27.  
  28. command /purchase [<text>]:
  29. trigger:
  30. if arg 1 is "woodpick":
  31. if player's balance >= 15:
  32. remove 15 from player's balance
  33. message "&a[NPC] Miner: &fThanks for buying a &eWooden Pickaxe &ffor &2$15&f, &e%player%&f!"
  34. give wood pick to player
  35. else:
  36. message "&c&lHey! &7You don't have enough money to buy this!"
  37. if arg 1 is "stonepick":
  38. if {level::%uuid of player%} >= 5:
  39. if player's balance >= 30:
  40. remove 30 from player's balance
  41. message "&a[NPC] Miner: &fThanks for buying a &eStone Pickaxe &ffor &2$30&f, &e%player%&f!"
  42. give stone pick to player
  43. else:
  44. message "&c&lHey! &7You don't have enough money to buy this!"
  45. else:
  46. message "&c&lHey! &7You must be Level 5 or higher to purchase this."
  47. if arg 1 is "ironpick":
  48. if {level::%uuid of player%} >= 10:
  49. if player's balance >= 45:
  50. remove 45 from player's balance
  51. message "&a[NPC] Miner: &fThanks for buying a &eIron Pickaxe &ffor &2$45&f, &e%player%&f!"
  52. give iron pick to player
  53. else:
  54. message "&c&lHey! &7You don't have enough money to buy this!"
  55. else:
  56. message "&c&lHey! &7You must be Level 10 or higher to purchase this."
  57. if arg 1 is "diamondpick":
  58. if {level::%uuid of player%} >= 20:
  59. if player's balance >= 75:
  60. remove 75 from player's balance
  61. message "&a[NPC] Miner: &fThanks for buying a &eDiamond Pickaxe &ffor &2$45&f, &e%player%&f!"
  62. give diamond pick to player
  63. else:
  64. message "&c&lHey! &7You don't have enough money to buy this!"
  65. else:
  66. message "&c&lHey! &7You must be Level 20 or higher to purchase this."
  67. if arg 1 is "goldpick":
  68. if {level::%uuid of player%} >= 30:
  69. if player's balance >= 150:
  70. remove 150 from player's balance
  71. message "&a[NPC] Miner: &fThanks for buying a &eGold Pickaxe &ffor &2$45&f, &e%player%&f!"
  72. give gold pick to player
  73. else:
  74. message "&c&lHey! &7You don't have enough money to buy this!"
  75. else:
  76. message "&c&lHey! &7You must be Level 30 or higher to purchase this."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement