HazzelDoesStuff

Untitled

Aug 1st, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.42 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" with lore "&r ||&fPrice &a$0.15 each||&r ||&6&lClick &fto sell all your coal." to run [player command "/sell coalore"]
  11.  
  12. format slot 11 of player with iron ore named "&e&lIron" with lore "&r ||&fPrice &a$0.45 each||&r ||&6&lClick &fto sell all your iron." to run [player command "/sell ironore"]
  13.  
  14. format slot 12 of player with gold ore named "&e&lGold" with lore "&r ||&fPrice &a$0.75 each||&r ||&6&lClick &fto sell all your gold." to run [player command "/sell goldore"]
  15.  
  16. format slot 13 of player with diamond ore named "&e&lDiamond" with lore "&r ||&fPrice &a$1.35 each||&r ||&6&lClick &fto sell all your diamonds." to run [player command "/sell diamondore"]
  17.  
  18. format slot 14 of player with emerald ore named "&e&lEmerald" with lore "&r ||&fPrice &a$2 each||&r ||&6&lClick &fto sell all your emeralds." to run [player command "/sell emeraldore"]
  19.  
  20.  
  21.  
  22. if arg 1 is "coalore":
  23. if player has coal:
  24. while amount of coal in player's inventory is bigger than 0:
  25. add 1 to {_amount.%player%}
  26. remove 1 coal from player's inventory
  27. add 0.15 to {_payout.%player%}
  28. message ""
  29. message " &e&lSold %{_amount.%player%}% Items:"
  30. message ""
  31. message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
  32. message "&7 and received &a$%{_payout.%player%}% &7in total."
  33. message ""
  34. add {_payout.%player%} to player's balance
  35. stop
  36. else:
  37. message "&c&lHey! &7You don't have enough of this item to sell it."
  38. if arg 1 is "ironore":
  39. if player has iron ingot:
  40. while amount of iron ingot in player's inventory is bigger than 0:
  41. add 1 to {_amount.%player%}
  42. remove 1 iron ingot from player's inventory
  43. add 0.45 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. if arg 1 is "goldore":
  55. if player has gold:
  56. while amount of gold ingot in player's inventory is bigger than 0:
  57. add 1 to {_amount.%player%}
  58. remove 1 gold ingot from player's inventory
  59. add 0.75 to {_payout.%player%}
  60. message ""
  61. message " &e&lSold %{_amount.%player%}% Items:"
  62. message ""
  63. message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
  64. message "&7 and received &a$%{_payout.%player%}% &7in total."
  65. message ""
  66. add {_payout.%player%} to player's balance
  67. stop
  68. else:
  69. message "&c&lHey! &7You don't have enough of this item to sell it."
  70. if arg 1 is "diamondore":
  71. if player has diamond:
  72. while amount of diamond in player's inventory is bigger than 0:
  73. add 1 to {_amount.%player%}
  74. remove 1 diamond from player's inventory
  75. add 1.35 to {_payout.%player%}
  76. message ""
  77. message " &e&lSold %{_amount.%player%}% Items:"
  78. message ""
  79. message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
  80. message "&7 and received &a$%{_payout.%player%}% &7in total."
  81. message ""
  82. add {_payout.%player%} to player's balance
  83. stop
  84. else:
  85. message "&c&lHey! &7You don't have enough of this item to sell it."
  86. if arg 1 is "emeraldore":
  87. if player has emerald:
  88. while amount of emerald in player's inventory is bigger than 0:
  89. add 1 to {_amount.%player%}
  90. remove 1 emerald from player's inventory
  91. add 2 to {_payout.%player%}
  92. message ""
  93. message " &e&lSold %{_amount.%player%}% Items:"
  94. message ""
  95. message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
  96. message "&7 and received &a$%{_payout.%player%}% &7in total."
  97. message ""
  98. add {_payout.%player%} to player's balance
  99. stop
  100. else:
  101. message "&c&lHey! &7You don't have enough of this item to sell it."
Advertisement
Add Comment
Please, Sign In to add comment