Advertisement
twogz

Untitled

Jul 22nd, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.64 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.  
  12. format slot 11 of player with iron ore named "&e&lIron Ore" with lore "&r ||&fPrice &a$0.45 each||&r ||&6&lClick &fto sell all your coal ore." to run [player command "/sell ironore"]
  13.  
  14. format slot 12 of player with gold ore named "&e&lGold Ore" with lore "&r ||&fPrice &a$0.75 each||&r ||&6&lClick &fto sell all your coal ore." to run [player command "/sell goldore"]
  15.  
  16. format slot 13 of player with diamond ore named "&e&lDiamond Ore" with lore "&r ||&fPrice &a$1.35 each||&r ||&6&lClick &fto sell all your coal ore." to run [player command "/sell diamondore"]
  17.  
  18. if arg 1 is "coalore":
  19. if player has coal ore:
  20. while amount of coal ore in player's inventory is bigger than 0:
  21. add 1 to {_amount.%player%}
  22. remove 1 coal ore from player's inventory
  23. add 0.15 to {_payout.%player%}
  24. message ""
  25. message " &e&lSold %{_amount.%player%}% Items:"
  26. message ""
  27. message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
  28. message "&7 and received &a$%{_payout.%player%}% &7in total."
  29. message ""
  30. add {_payout.%player%} to player's balance
  31. stop
  32. else:
  33. message "&c&lHey! &7You don't have enough of this item to sell it."
  34. if arg 1 is "ironore":
  35. if player has iron ore:
  36. while amount of iron ore in player's inventory is bigger than 0:
  37. add 1 to {_amount.%player%}
  38. remove 1 coal ore from player's inventory
  39. add 0.45 to {_payout.%player%}
  40. message ""
  41. message " &e&lSold %{_amount.%player%}% Items:"
  42. message ""
  43. message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
  44. message "&7 and received &a$%{_payout.%player%}% &7in total."
  45. message ""
  46. add {_payout.%player%} to player's balance
  47. stop
  48. else:
  49. message "&c&lHey! &7You don't have enough of this item to sell it."
  50. if arg 1 is "goldore":
  51. if player has gold ore:
  52. while amount of gold ore in player's inventory is bigger than 0:
  53. add 1 to {_amount.%player%}
  54. remove 1 gold ore from player's inventory
  55. add 0.75 to {_payout.%player%}
  56. message ""
  57. message " &e&lSold %{_amount.%player%}% Items:"
  58. message ""
  59. message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
  60. message "&7 and received &a$%{_payout.%player%}% &7in total."
  61. message ""
  62. add {_payout.%player%} to player's balance
  63. stop
  64. else:
  65. message "&c&lHey! &7You don't have enough of this item to sell it."
  66. if arg 1 is "diamondore":
  67. if player has diamond ore:
  68. while amount of diamond ore in player's inventory is bigger than 0:
  69. add 1 to {_amount.%player%}
  70. remove 1 diamond ore from player's inventory
  71. add 1.35 to {_payout.%player%}
  72. message ""
  73. message " &e&lSold %{_amount.%player%}% Items:"
  74. message ""
  75. message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
  76. message "&7 and received &a$%{_payout.%player%}% &7in total."
  77. message ""
  78. add {_payout.%player%} to player's balance
  79. stop
  80. else:
  81. message "&c&lHey! &7You don't have enough of this item to sell it."
  82.  
  83. command /purchase [<text>]:
  84. trigger:
  85. if arg 1 is "woodpick":
  86. if player's balance >= 15:
  87. remove 15 from player's balance
  88. message "&a[NPC] Miner: &fThanks for buying a &eWooden Pickaxe &ffor &2$15&f, &e%player%&f!"
  89. give wood pick to player
  90. else:
  91. message "&c&lHey! &7You don't have enough money to buy this!"
  92. if arg 1 is "stonepick":
  93. if {level::%uuid of player%} >= 5:
  94. if player's balance >= 30:
  95. remove 30 from player's balance
  96. message "&a[NPC] Miner: &fThanks for buying a &eStone Pickaxe &ffor &2$30&f, &e%player%&f!"
  97. give stone pick to player
  98. else:
  99. message "&c&lHey! &7You don't have enough money to buy this!"
  100. else:
  101. message "&c&lHey! &7You must be Level 5 or higher to purchase this."
  102. if arg 1 is "ironpick":
  103. if {level::%uuid of player%} >= 10:
  104. if player's balance >= 45:
  105. remove 45 from player's balance
  106. message "&a[NPC] Miner: &fThanks for buying a &eIron Pickaxe &ffor &2$45&f, &e%player%&f!"
  107. give iron pick to player
  108. else:
  109. message "&c&lHey! &7You don't have enough money to buy this!"
  110. else:
  111. message "&c&lHey! &7You must be Level 10 or higher to purchase this."
  112. if arg 1 is "diamondpick":
  113. if {level::%uuid of player%} >= 20:
  114. if player's balance >= 75:
  115. remove 75 from player's balance
  116. message "&a[NPC] Miner: &fThanks for buying a &eDiamond Pickaxe &ffor &2$45&f, &e%player%&f!"
  117. give diamond pick to player
  118. else:
  119. message "&c&lHey! &7You don't have enough money to buy this!"
  120. else:
  121. message "&c&lHey! &7You must be Level 20 or higher to purchase this."
  122. if arg 1 is "goldpick":
  123. if {level::%uuid of player%} >= 30:
  124. if player's balance >= 150:
  125. remove 150 from player's balance
  126. message "&a[NPC] Miner: &fThanks for buying a &eGold Pickaxe &ffor &2$45&f, &e%player%&f!"
  127. give gold pick to player
  128. else:
  129. message "&c&lHey! &7You don't have enough money to buy this!"
  130. else:
  131. message "&c&lHey! &7You must be Level 30 or higher to purchase this."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement