Advertisement
twogz

Untitled

Jul 24th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.94 KB | None | 0 0
  1. command /sell [<text>]:
  2. trigger:
  3. if arg 1 is not set:
  4. execute player command "/merchant"
  5.  
  6. if arg 1 is "coal":
  7. if player has coal item:
  8. while amount of coal item in player's inventory is bigger than 0:
  9. add 1 to {_amount.%player%}
  10. remove 1 coal item from player's inventory
  11. add 0.10 to {_payout.%player%}
  12. message ""
  13. message " &aSold %{_amount.%player%}% Items:"
  14. message ""
  15. message "&7 You sold &d%{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
  16. message "&7 and received &b$%{_payout.%player%}% &7in total."
  17. message ""
  18. add {_payout.%player%} to player's balance
  19. stop
  20. else:
  21. message "&c&lHey! &7You don't have enough of this item to sell it."
  22.  
  23. if arg 1 is "iron":
  24. if {level.%uuid of player%} >= 10:
  25. if player has iron ingot:
  26. while amount of iron ingot in player's inventory is bigger than 0:
  27. add 1 to {_amount.%player%}
  28. remove 1 iron ingot from player's inventory
  29. add 0.15 to {_payout.%player%}
  30. message ""
  31. message " &aSold %{_amount.%player%}% Items:"
  32. message ""
  33. message "&7 You sold &d%{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
  34. message "&7 and received &b$%{_payout.%player%}% &7in total."
  35. message ""
  36. add {_payout.%player%} to player's balance
  37. stop
  38. else:
  39. message "&c&lHey! &7You don't have enough of this item to sell it."
  40. else:
  41. message "&c&lHey! &7You must be &bLevel 10 &7to sell this."
  42.  
  43. if arg 1 is "gold":
  44. if {level.%uuid of player%} >= 20:
  45. if player has gold ingot:
  46. while amount of gold ingot in player's inventory is bigger than 0:
  47. add 1 to {_amount.%player%}
  48. remove 1 gold ingot from player's inventory
  49. add 0.20 to {_payout.%player%}
  50. message ""
  51. message " &aSold %{_amount.%player%}% Items:"
  52. message ""
  53. message "&7 You sold &d%{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
  54. message "&7 and received &b$%{_payout.%player%}% &7in total."
  55. message ""
  56. add {_payout.%player%} to player's balance
  57. stop
  58. else:
  59. message "&c&lHey! &7You don't have enough of this item to sell it."
  60. else:
  61. message "&c&lHey! &7You must be &bLevel 20 &7to sell this."
  62.  
  63. if arg 1 is "redstone":
  64. if {level.%uuid of player%} >= 30:
  65. if player has redstone dust:
  66. while amount of redstone dust in player's inventory is bigger than 0:
  67. add 1 to {_amount.%player%}
  68. remove 1 redstone dust from player's inventory
  69. add 0.30 to {_payout.%player%}
  70. message ""
  71. message " &aSold %{_amount.%player%}% Items:"
  72. message ""
  73. message "&7 You sold &d%{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
  74. message "&7 and received &b$%{_payout.%player%}% &7in total."
  75. message ""
  76. add {_payout.%player%} to player's balance
  77. stop
  78. else:
  79. message "&c&lHey! &7You don't have enough of this item to sell it."
  80. else:
  81. message "&c&lHey! &7You must be &bLevel 30 &7to sell this."
  82.  
  83. if arg 1 is "diamond":
  84. if {level.%uuid of player%} >= 50:
  85. if player has diamond:
  86. while amount of diamond in player's inventory is bigger than 0:
  87. add 1 to {_amount.%player%}
  88. remove 1 diamond from player's inventory
  89. add 1 to {_payout.%player%}
  90. message ""
  91. message " &aSold %{_amount.%player%}% Items:"
  92. message ""
  93. message "&7 You sold &d%{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
  94. message "&7 and received &b$%{_payout.%player%}% &7in total."
  95. message ""
  96. add {_payout.%player%} to player's balance
  97. stop
  98. else:
  99. message "&c&lHey! &7You don't have enough of this item to sell it."
  100. else:
  101. message "&c&lHey! &7You must be &bLevel 50 &7to sell this."
  102.  
  103. if arg 1 is "emerald":
  104. if {level.%uuid of player%} >= 75:
  105. if player has emerald:
  106. while amount of emerald in player's inventory is bigger than 0:
  107. add 1 to {_amount.%player%}
  108. remove 1 emerald from player's inventory
  109. add 1.75 to {_payout.%player%}
  110. message ""
  111. message " &aSold %{_amount.%player%}% Items:"
  112. message ""
  113. message "&7 You sold &d%{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
  114. message "&7 and received &b$%{_payout.%player%}% &7in total."
  115. message ""
  116. add {_payout.%player%} to player's balance
  117. stop
  118. else:
  119. message "&c&lHey! &7You don't have enough of this item to sell it."
  120. else:
  121. message "&c&lHey! &7You must be &bLevel 75 &7to sell this."
  122.  
  123. if arg 1 is "quartz":
  124. if {level.%uuid of player%} >= 100:
  125. if player has quartz item:
  126. while amount of quartz item in player's inventory is bigger than 0:
  127. add 1 to {_amount.%player%}
  128. remove 1 quartz item from player's inventory
  129. add 2.50 to {_payout.%player%}
  130. message ""
  131. message " &aSold %{_amount.%player%}% Items:"
  132. message ""
  133. message "&7 You sold &d%{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
  134. message "&7 and received &b$%{_payout.%player%}% &7in total."
  135. message ""
  136. add {_payout.%player%} to player's balance
  137. stop
  138. else:
  139. message "&c&lHey! &7You don't have enough of this item to sell it."
  140. else:
  141. message "&c&lHey! &7You must be &bLevel 100 &7to sell this."
  142.  
  143. if arg 1 is "lapis":
  144. if {level.%uuid of player%} >= 40:
  145. if player has lapis:
  146. while amount of lapis in player's inventory is bigger than 0:
  147. add 1 to {_amount.%player%}
  148. remove 1 lapis from player's inventory
  149. add 0.50 to {_payout.%player%}
  150. message ""
  151. message " &aSold %{_amount.%player%}% Items:"
  152. message ""
  153. message "&7 You sold &d%{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
  154. message "&7 and received &b$%{_payout.%player%}% &7in total."
  155. message ""
  156. add {_payout.%player%} to player's balance
  157. stop
  158. else:
  159. message "&c&lHey! &7You don't have enough of this item to sell it."
  160. else:
  161. message "&c&lHey! &7You must be &bLevel 40 &7to sell this."
  162.  
  163. command /merchant:
  164. trigger:
  165. message "&a[NPC] Merchant: &fHey %player%, come sell some items!"
  166. open chest with 5 rows named "The Merchant" to player
  167.  
  168. wait 0.6 ticks
  169.  
  170. format slot 4 of player with nether star named "&a&l%player%'s Balance" with lore "&fYou have &2%player's balance%" to be unstealable
  171.  
  172. format slot 20 of player with coal item named "&eCoal" with lore "&cRequired Level: 0||||&fPrice: &a$0.10 each||||&fClick here to sell." to run [player command "/sell coal"]
  173.  
  174. format slot 21 of player with iron ingot named "&eIron" with lore "&cRequired Level: 10||||&fPrice: &a$0.15 each||||&fClick here to sell." to run [player command "/sell iron"]
  175.  
  176. format slot 22 of player with gold ingot named "&eGold" with lore "&cRequired Level: 20||||&fPrice: &a$0.20 each||||&fClick here to sell." to run [player command "/sell gold"]
  177.  
  178. format slot 23 of player with redstone dust named "&eRedstone" with lore "&cRequired Level: 30||||&fPrice: &a$0.30 each||||&fClick here to sell." to run [player command "/sell redstone"]
  179.  
  180. format slot 24 of player with lapis lazuli named "&eLapis Lazuli" with lore "&cRequired Level: 40||||&fPrice: &a$0.50 each||||&fClick here to sell." to run [player command "/sell lapis"]
  181.  
  182. format slot 30 of player with diamond named "&eDiamond" with lore "&cRequired Level: 50||||&fPrice: &a$1 each||||&fClick here to sell." to run [player command "/sell diamond"]
  183.  
  184. format slot 31 of player with emerald named "&eEmerald" with lore "&cRequired Level: 75||||&fPrice: &a$1.75 each||||&fClick here to sell." to run [player command "/sell emerald"]
  185.  
  186. format slot 32 of player with quartz item named "&eQuartz" with lore "&cRequired Level: 100||||&fPrice: &a$2.50 each||||&fClick here to sell." to run [player command "/sell quartz"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement