Advertisement
twogz

Untitled

Jul 22nd, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 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. while amount of coal ore in player's inventory is bigger than 0:
  13. add 1 to {_amount.%player%}
  14. remove 1 coal ore from player's inventory
  15. add 0.15 to {_payout.%player%}
  16. message ""
  17. message " &e&lSold %{_amount.%player%}% Items:"
  18. message ""
  19. message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
  20. message "&7 and received &a$%{_payout.%player%}% &7in total."
  21. message ""
  22. add {_payout.%player%} to player's balance
  23. stop
  24. else:
  25. message "&c&lHey! &7You don't have enough of this item to sell it."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement