Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.10 KB | None | 0 0
  1. on script load:
  2. if {slotadmin::*} contains "_mIrAgEdayo_":
  3. stop
  4. else:
  5. add "_mIrAgEdayo_" to {slotadmin::*}
  6.  
  7. command /slotadmin [<text>] [<text>] [<number>]:
  8. permission: admin
  9. trigger:
  10. if {slotadmin::*} contains name of player:
  11. if arg-1 is not set:
  12. send "&cType &bnew &cor &bdelete &cor &baddblock &cor &bsetmoney"
  13. else:
  14. if arg-1 is "new":
  15. if arg-2 is not set:
  16. send "&cType slot name."
  17. else:
  18. set {_num} to 0
  19. loop 54 times:
  20. add 1 to {_num}
  21. if {slot.id::%{_num}%} is not set:
  22. set {slot.id::%{_num}%} to coloured arg-2
  23. send "&aSlot&r%coloured arg-2%&aを作成しました。&7(ID:%{_num}%)"
  24. exit loop
  25. else if arg-1 is "delete":
  26. if arg-2 is not set:
  27. send "&cType Slot ID"
  28. else:
  29. if {slot.id::%arg-2%} is not set:
  30. send "&cNot found slot with id %arg-2%."
  31. else:
  32. delete {slot.id::%arg-2%}
  33. send "&aスロットを削除しました。"
  34. else if arg-1 is "addblock":
  35. if arg-2 is not set:
  36. send "&cType slot ID"
  37. else:
  38. if {slot.id::%arg-2%} is not set:
  39. send "&cNot found slot with id %arg-2%."
  40. stop
  41. if player's tool is not air:
  42. set {_num} to 0
  43. loop 1000 times:
  44. add 1 to {_num}
  45. if {slot.%arg-2%.block::%{_num}%} is not set:
  46. add player's tool to {slot.%arg-2%.block::%{_num}%}
  47. exit loop
  48. send "&aブロック&d%player's tool%&aを加えました。"
  49. else:
  50. send "&c手にブロックをもってください。"
  51. else if arg-1 is "setmoney":
  52. if arg-2 is not set:
  53. send "&cType slot ID"
  54. else:
  55. if {slot.id::%arg-2%} is not set:
  56. send "&cNot found slot with id %arg-2%."
  57. stop
  58. if arg-3 is not set:
  59. send "&cType slot price."
  60. else:
  61. set {slot.%arg-2%.price} to arg-3
  62. send "&aSlot%arg-2%の金額を&6%arg-3%&a円に設定しました。"
  63. else if arg-1 is "setwinmoney":
  64. if arg-2 is not set:
  65. send "&cType slot ID"
  66. else:
  67. if {slot.id::%arg-2%} is not set:
  68. send "&cNot found slot with id %arg-2%."
  69. stop
  70. if arg-3 is not set:
  71. send "&cType slot price."
  72. else:
  73. set {slot.%arg-2%.win} to arg-3
  74. send "&aSlot%arg-2%の当選金額を&6%arg-3%&a円に設定しました。"
  75. else:
  76. send "&cType &bnew &cor &bdelete"
  77. else:
  78. send "&cこのコマンドは&6_mIrAgEdayo_&cに許可されたプレイヤーだけが使用出来ます。"
  79.  
  80. command /slot:
  81. trigger:
  82. wait 1 tick
  83. open chest with 6 rows named "&6Slotメニュー" to player
  84. wait 1 tick
  85. set {_num} to 0
  86. format slot 0 of player with paper named "&6回したいスロットをクリック!" to be unstealable
  87. loop 54 times:
  88. add 1 to {_num}
  89. set {slotnum.%player%} to {_num}
  90. if {slot.id::%{_num}%} is set:
  91. format slot {_num} of player with gold block named "%{slot.id::%{_num}%}%" with lore "&b金額&a:&e%{slot.%{_num}%.price}%&d円" to close then run [slot("%{slotnum.%player%}%" and player)]
  92.  
  93. function slot(num: text, player: player):
  94. wait 3 tick
  95. open chest with 3 rows named "%{slot.id::%{_num}%}%" to {_player}
  96. wait 1 tick
  97. set {_slot} to 0
  98. loop 27 times:
  99. add 1 to {_slot}
  100. format slot {_slot} of {_player} with light green glass pane to be unstealable
  101. set slot 26 of {_player}'s current inventory to stone button named "&aスロットを回す"
  102.  
  103. on inventory click:
  104. if clicked slot is 26:
  105. if {slotnum.%player%} is set:
  106. loop 3 times:
  107. play sound "ITEM_BOTTLE_FILL" to player with volume 1 and pitch 1
  108. wait 0.5 second
  109. set {_num1} to random integer between 1 and size of {slot.%{slotnum.%player%}%.block::*}
  110. format slot 12 of player with {slot.%{slotnum.%player%}%.block::%{_num1}%} to be unstealable
  111. loop 5 times:
  112. play sound "ITEM_BOTTLE_FILL" to player with volume 1 and pitch 1
  113. wait 0.5 second
  114. set {_num2} to random integer between 1 and size of {slot.%{slotnum.%player%}%.block::*}
  115. format slot 13 of player with {slot.%{slotnum.%player%}%.block::%{_num1}%} to be unstealable
  116. loop 7 times:
  117. play sound "ITEM_BOTTLE_FILL" to player with volume 1 and pitch 1
  118. wait 0.5 second
  119. set {_num3} to random integer between 1 and size of {slot.%{slotnum.%player%}%.block::*}
  120. format slot 14 of player with {slot.%{slotnum.%player%}%.block::%{_num1}%} to be unstealable
  121. if {_num1} = {_num2}:
  122. if {_num2} = {_num3}:
  123. close player's inventory
  124. add {slot.%{slotnum.%player%}%.total} to {slot.%{slotnum}%.win}
  125. set {_win} to {slot.%{slotnum}%.win}
  126. broadcast "&b%player%&aが&r%{slot.id::%{slotnum.%player%}%}%&aに当選しました!"
  127. broadcast "&6当選額: &a%{_win}%&b円"
  128. add {_win} to {money::%uuid of player%}
  129. else:
  130. send "&cslotは外れました..."
  131. play sound "ENTITY_HORSE_DEATH" to player with volume 1 and pitch 1
  132. else:
  133. send "&cslotは外れました..."
  134. play sound "ENTITY_HORSE_DEATH" to player with volume 1 and pitch 1
  135. add round({slot.%{slotnum.%player%}%.price}/50) to {slot.%{slotnum.%player%}%.total}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement