Advertisement
jakelive_

Untitled

Feb 17th, 2020
510
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.23 KB | None | 0 0
  1. function sellall(totalblocks: integer, price: integer) :: number:
  2. set {_result} to {_totalblocks} * {_price}
  3. return {_result}
  4.  
  5. command /sellall:
  6. trigger:
  7. set {_cobble} to the amount of cobblestone in the player's inventory
  8. set {_coal} to the amount of coal in the player's inventory
  9. set {_iron} to the amount of iron ore in the player's inventory
  10. set {_gold} to the amount of gold ore in the player's inventory
  11. set {_redstone} to the amount of redstone in the player's inventory
  12. set {_lapis} to the amount of lapis in the player's inventory
  13. set {_diamond} to the amount of diamond in the player's inventory
  14. wait 1 tick
  15. set {_functiongive} to sellall({_cobble}, 1)
  16. add {_functiongive} to {%player%.tokens}
  17. send "%{_functiongive}% - funcgive, %{_cobble}% - cobble, %{%player%.tokens}%, -playertokens"
  18. wait 1 tick
  19. set {_functiongive} to sellall({_coal}, 3)
  20. add {_functiongive} to {%player%.tokens}
  21. send "%{_functiongive}% - funcgive, %{_coal}% - cobble, %{%player%.tokens}%, -playertokens"
  22. wait 1 tick
  23. set {_functiongive} to sellall({_iron}, 5)
  24. add {_functiongive} to {%player%.tokens}
  25. send "%{_functiongive}% - funcgive, %{_iron}% - cobble, %{%player%.tokens}%, -playertokens"
  26. wait 1 tick
  27. set {_functiongive} to sellall({_gold}, 6)
  28. add {_functiongive} to {%player%.tokens}
  29. send "%{_functiongive}% - funcgive, %{_gold}% - cobble, %{%player%.tokens}%, -playertokens"
  30. wait 1 tick
  31. set {_functiongive} to sellall({_redstone}, 4)
  32. add {_functiongive} to {%player%.tokens}
  33. send "%{_functiongive}% - funcgive, %{_redstone}% - cobble, %{%player%.tokens}%, -playertokens"
  34. wait 1 tick
  35. set {_functiongive} to sellall({_lapis}, 4)
  36. add {_functiongive} to {%player%.tokens}
  37. send "%{_functiongive}% - funcgive, %{_lapis}% - cobble, %{%player%.tokens}%, -playertokens"
  38. wait 1 tick
  39. set {_functiongive} to sellall({_diamond}, 8)
  40. add {_functiongive} to {%player%.tokens}
  41. send "%{_functiongive}% - funcgive, %{_diamond}% - cobble, %{%player%.tokens}%, -playertokens"
  42. wait 1 tick
  43. remove {_cobble} of cobblestone from player's inventory
  44. remove {_coal} of coal from player's inventory
  45. remove {_iron} of iron ore from player's inventory
  46. remove {_gold} of gold ore from player's inventory
  47. remove {_redstone} of redstone from player's inventory
  48. remove {_lapis} of lapis from player's inventory
  49. remove {_diamond} of diamond from player's inventory
  50. send "&7sold &3%{_cobble}% &7cobblestone"
  51. send "&7sold &3%{_coal}% &7coal"
  52. send "&7sold &3%{_iron}% &7iron ore"
  53. send "&7sold &3%{_gold}% &7gold ore"
  54. send "&7sold &3%{_redstone}% &7redstone"
  55. send "&7sold &3%{_lapis}% &7lapis"
  56. send "&7sold &3%{_diamond}% &7diamonds"
  57. if {%player%.tokens} > 1000:
  58. send "&aYou can now use /convert to get &6Playtime tokens!"
  59. stop
  60. if {%player%.tokens} < 1000:
  61. send "&cKeep it up! only need 1000 tokens for each &6Playtime token!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement