Advertisement
twogz

Untitled

Jul 21st, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.31 KB | None | 0 0
  1. command /sell [<text>]:
  2. trigger:
  3.  
  4. if arg 1 is "cobblestone":
  5. if player has cobblestone:
  6. while amount of cobblestone in player's inventory is bigger than 0:
  7. add 1 to {_amount.%player%}
  8. remove 1 cobble from player's inventory
  9. add 0.05 to {_payout.%player%}
  10. message ""
  11. message " &e&lSold %{_amount.%player%}% Items:"
  12. message ""
  13. message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
  14. message "&7 and received &a$%{_payout.%player%}% &7in total."
  15. message ""
  16. add {_payout.%player%} to player's balance
  17. stop
  18. else:
  19. message "&c&lHey! &7You don't have enough of this item to sell it."
  20.  
  21. if arg 1 is "stone":
  22. if player has stone:
  23. while amount of stone in player's inventory is bigger than 0:
  24. add 1 to {_amount.%player%}
  25. remove 1 stone from player's inventory
  26. add 0.07 to {_payout.%player%}
  27. message ""
  28. message " &e&lSold %{_amount.%player%}% Items:"
  29. message ""
  30. message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
  31. message "&7 and received &a$%{_payout.%player%}% &7in total."
  32. message ""
  33. add {_payout.%player%} to player's balance
  34. stop
  35. else:
  36. message "&c&lHey! &7You don't have enough of this item to sell it."
  37.  
  38. if arg 1 is "charcoal":
  39. if player has charcoal:
  40. while amount of charcoal in player's inventory is bigger than 0:
  41. add 1 to {_amount.%player%}
  42. remove 1 charcoal from player's inventory
  43. add 0.10 to {_payout.%player%}
  44. message ""
  45. message " &e&lSold %{_amount.%player%}% Items:"
  46. message ""
  47. message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
  48. message "&7 and received &a$%{_payout.%player%}% &7in total."
  49. message ""
  50. add {_payout.%player%} to player's balance
  51. stop
  52. else:
  53. message "&c&lHey! &7You don't have enough of this item to sell it."
  54.  
  55. if arg 1 is "coal":
  56. if player has coal item:
  57. while amount of coal item in player's inventory is bigger than 0:
  58. add 1 to {_amount.%player%}
  59. remove 1 coal item from player's inventory
  60. add 0.15 to {_payout.%player%}
  61. message ""
  62. message " &e&lSold %{_amount.%player%}% Items:"
  63. message ""
  64. message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
  65. message "&7 and received &a$%{_payout.%player%}% &7in total."
  66. message ""
  67. add {_payout.%player%} to player's balance
  68. stop
  69. else:
  70. message "&c&lHey! &7You don't have enough of this item to sell it."
  71.  
  72. if arg 1 is "ironnugget":
  73. if player has iron nugget:
  74. while amount of iron nugget in player's inventory is bigger than 0:
  75. add 1 to {_amount.%player%}
  76. remove 1 iron nugget from player's inventory
  77. add 0.30 to {_payout.%player%}
  78. message ""
  79. message " &e&lSold %{_amount.%player%}% Items:"
  80. message ""
  81. message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
  82. message "&7 and received &a$%{_payout.%player%}% &7in total."
  83. message ""
  84. add {_payout.%player%} to player's balance
  85. stop
  86. else:
  87. message "&c&lHey! &7You don't have enough of this item to sell it."
  88.  
  89. if arg 1 is "ironingot":
  90. if player has iron ingot:
  91. while amount of iron ingot in player's inventory is bigger than 0:
  92. add 1 to {_amount.%player%}
  93. remove 1 iron ingot from player's inventory
  94. add 0.50 to {_payout.%player%}
  95. message ""
  96. message " &e&lSold %{_amount.%player%}% Items:"
  97. message ""
  98. message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
  99. message "&7 and received &a$%{_payout.%player%}% &7in total."
  100. message ""
  101. add {_payout.%player%} to player's balance
  102. stop
  103. else:
  104. message "&c&lHey! &7You don't have enough of this item to sell it."
  105.  
  106. if arg 1 is "goldnugget":
  107. if player has gold nugget:
  108. while amount of gold nugget in player's inventory is bigger than 0:
  109. add 1 to {_amount.%player%}
  110. remove 1 gold nugget from player's inventory
  111. add 0.60 to {_payout.%player%}
  112. message ""
  113. message " &e&lSold %{_amount.%player%}% Items:"
  114. message ""
  115. message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
  116. message "&7 and received &a$%{_payout.%player%}% &7in total."
  117. message ""
  118. add {_payout.%player%} to player's balance
  119. stop
  120. else:
  121. message "&c&lHey! &7You don't have enough of this item to sell it."
  122.  
  123. if arg 1 is "goldingot":
  124. if player has gold ingot:
  125. while amount of gold ingot in player's inventory is bigger than 0:
  126. add 1 to {_amount.%player%}
  127. remove 1 gold ingot from player's inventory
  128. add 0.70 to {_payout.%player%}
  129. message ""
  130. message " &e&lSold %{_amount.%player%}% Items:"
  131. message ""
  132. message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
  133. message "&7 and received &a$%{_payout.%player%}% &7in total."
  134. message ""
  135. add {_payout.%player%} to player's balance
  136. stop
  137. else:
  138. message "&c&lHey! &7You don't have enough of this item to sell it."
  139.  
  140.  
  141. if arg 1 is not set:
  142. execute player command "/sellall"
  143.  
  144. command /sellall:
  145. trigger:
  146. open chest with 4 rows named "Sell your items" to player
  147.  
  148. wait 0.6 ticks
  149.  
  150. format slot 0 of player with paper named "&a&lYour Balance" with lore "&fMoney &a%player's balance%" to be unstealable
  151.  
  152. format slot 10 of player with cobblestone named "&e&lLow Quality Stone" with lore "&7&oTier 1 Item||||&fPrice &a$0.05 each||&r ||&6&lClick &fto sell all your low quality stone." to run [player command "/sell cobblestone"]
  153. format slot 19 of player with stone named "&e&lHigh Quality Stone" with lore "&7&oTier 2 Item||||&fPrice &a$0.07 each||&r ||&6&lClick &fto sell all your high quality stone." to run [player command "/sell stone"]
  154. format slot 11 of player with charcoal named "&e&lLow Quality Coal" with lore "&7&oTier 1 Item||||&fPrice &a$0.10 each||&r ||&6&lClick &fto sell all your low quality coal." to run [player command "/sell charcoal"]
  155. format slot 20 of player with coal item named "&e&lHigh Quality Coal" with lore "&7&oTier 2 Item||||&fPrice &a$0.15 each||&r ||&6&lClick &fto sell all your high quality coal." to run [player command "/sell coal"]
  156. format slot 12 of player with iron nugget named "&e&lLow Quality Iron" with lore "&7&oTier 1 Item||||&fPrice &a$0.30 each||&r ||&6&lClick &fto sell all your low quality iron." to run [player command "/sell ironnugget"]
  157. format slot 21 of player with iron ingot named "&e&lHigh Quality Iron" with lore "&7&oTier 2 Item||||&fPrice &a$0.50 each||&r ||&6&lClick &fto sell all your high quality iron" to run [player command "/sell ironingot"]
  158. format slot 13 of player with gold nugget named "&e&lLow Quality Gold" with lore "&7&oTier 1 Item||||&fPrice &a$0.60 each||&r ||&6&lClick &fto sell all your low quality gold." to run [player command "/sell goldnugget"]
  159. format slot 22 of player with gold ingot named "&e&lHigh Quality Gold" with lore "&7&oTier 2 Item||||&fPrice &a$0.70 each||&r ||&6&lClick &fto sell all your high quality gold" to run [player command "/sell goldingot"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement