Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.63 KB | None | 0 0
  1. options:
  2. SellWandPrefix: &b&lSELL WAND &8»
  3.  
  4. on load:
  5. set {sell:wand::name} to "&3→ &b&lSell-Wand &3←"
  6. delete {sell::item::*}
  7. set {sell::item::wheat} to wheat item
  8. set {sell::item::cactus} to cactus
  9. set {sell::item::sugarcane} to sugar cane
  10. set {sell::item::carrot} to carrot
  11. set {sell::item::wheat_seed} to wheat seed
  12. set {sell::item::pumpkin} to pumpkin
  13. set {sell::item::coal} to coal
  14. set {sell::item::iron} to iron ingot
  15. set {sell::item::gold} to gold ingot
  16. set {sell::item::lapis} to lapis
  17. set {sell::item::redstone} to redstone
  18. set {sell::item::glowstone} to glowstone dust
  19. set {sell::item::diamond} to diamond
  20. set {sell::item::quartz} to nether quartz
  21. set {sell::item::emerald} to emerald
  22. delete {sell::price::*}
  23. set {sell::price::wheat} to 20
  24. set {sell::price::wheat_seed} to 5
  25. set {sell::price::cactus} to 20
  26. set {sell::price::sugarcane} to 20
  27. set {sell::price::carrot} to 10
  28. set {sell::price::pumpkin} to 20
  29. set {sell::price::coal} to 15
  30. set {sell::price::iron} to 15
  31. set {sell::price::gold} to 90
  32. set {sell::price::lapis} to 20
  33. set {sell::price::redstone} to 25
  34. set {sell::price::glowstone} to 32
  35. set {sell::price::diamond} to 150
  36. set {sell::price::quartz} to 35
  37. set {sell::price::emerald} to 100
  38.  
  39. command /sellwand [<player>] [<integer>]:
  40. permission: skript.sellwand
  41. trigger:
  42. give arg-1 1 golden axe named "%{sell:wand::name}% (%arg-2%)" lored "&7Usage: &cRight-click on a chest to sell the items inside (made by xlr100)"
  43.  
  44.  
  45. on right click on chest or trapped chest or hopper with a golden axe:
  46. set {_name} to name of player's tool
  47. if {_name} contains "%{sell:wand::name}%":
  48. cancel event
  49. loop all items in inventory of clicked block:
  50. set {_item} to loop-value
  51. set {_item} to regex replace "[0-9]" with "" in "%{_item}%"
  52. replace all " items" and " item" in {_item} with ""
  53. set {_item} to {_item} parsed as itemtype
  54. if {sell::item::*} contains {_item}:
  55. set {_amount} to amount of {_item} in inventory of clicked block
  56. set {_amount} to {_amount} parsed as integer
  57. remove all {_item} from inventory of clicked block
  58. loop {sell::price::*}:
  59. if "%{sell::item::%loop-index%}%" = "%{_item}%":
  60. set {_price} to loop-value-2
  61. stop loop
  62. set {_money} to {_amount} * {_price}
  63. set {_m} to regex replace "(?<=\d)(?=(\d{3})+(?!\d))" with "," in "%{_money}%"
  64. add {_money} to {_total}
  65. set {_i} to "%{_item}%"
  66. replace all " items" and " item" in {_i} with ""
  67. send colored "{@SellWandPrefix} &7Sold %{_amount}% %{_i}% for %{_m}%$"
  68. if {_total} > 0:
  69. set {_t} to regex replace "(?<=\d)(?=(\d{3})+(?!\d))" with "," in "%{_total}%"
  70. add {_total} to player's balance
  71. send colored "{@SellWandPrefix} &aYou have recieved a total of %{_t}%$"
  72. set {_uses} to uncolored {_name}
  73. replace all "%uncolored {sell:wand::name}% (" and ")" in {_uses} with ""
  74. set {_uses} to {_uses} parsed as integer
  75. if {_uses} > 1:
  76. remove 1 from {_uses}
  77. set name of player's tool to "%{sell:wand::name}% (%{_uses}%)"
  78. else:
  79. send "{@SellWandPrefix} &cYour sell wand broke!"
  80. loop all items in player's inventory:
  81. name of loop-item contains "%{sell:wand::name}%"
  82. name of loop-item contains "(1)"
  83. wait 1 tick
  84. delete loop-item
  85. stop
  86. else:
  87. send colored "{@SellWandPrefix} &cThere are no sellable items in this inventory"
  88.  
  89. on join:
  90. set join message to "&8[&2&l+&8] &a%player%"
  91. on quit:
  92. set quit message to "&8[&4&l-&8] &c%player%"
  93. on first join:
  94. add 1 to {uj}
  95. broadcast "
  96. &7[&e&lFrag&6&lblock&7] &8&l- &e%player%&7, Welcome to the server, &8(&e##%{uj}%&8)"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement