Advertisement
twogz

Untitled

Jul 20th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. on break:
  2. if player's gamemode is survival:
  3. cancel event
  4.  
  5. if event-block is coal ore:
  6. give coal ore to player
  7. chance of 3%:
  8. give gunpowder named "&7&lLesser Arcane Dust" with lore "&8Hint: Used to enchant pickaxes." to player
  9. message "&c&lHey! &7You randomly found &f&nLesser Arcane Dust&7 while mining!"
  10. set event-block to cobble
  11. wait 2 seconds
  12. set event-block to stone
  13. wait 2 seconds
  14. set event-block to coal ore
  15.  
  16. on place:
  17. if player's gamemode is survival:
  18. if player does not have permission "admin":
  19. cancel event
  20.  
  21. command /sell [<text>]:
  22. trigger:
  23. if arg 1 is "coalore":
  24. if player has coal ore:
  25. while amount of coal ore in player's inventory is bigger than 0:
  26. add 1 to {_amount.%player%}
  27. remove 1 coal ore from player's inventory
  28. add 0.03 to {_payout.%player%}
  29. message ""
  30. message " &e&lSold %{_amount.%player%}% Items:"
  31. message ""
  32. message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
  33. message "&7 and received &a$%{_payout.%player%}% &7in total."
  34. message ""
  35. add {_payout.%player%} to player's balance
  36. stop
  37. else:
  38. message "&c&lHey! &7You don't have enough of this item to sell it."
  39.  
  40.  
  41. if arg 1 is not set:
  42. execute player command "/sellall"
  43.  
  44. command /sellall:
  45. trigger:
  46. open chest with 4 rows named "Sell your items" to player
  47.  
  48. wait 0.6 ticks
  49.  
  50. format slot 0 of player with paper named "&a&lYour Balance" with lore "&fMoney &a%player's balance%" to be unstealable
  51.  
  52. format slot 10 of player with coal ore named "&eCoal Ore" with lore "&r ||&7Price &a$0.03 each||&r ||&6Click to sell this item." to run [player command "/sell coalore"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement