tsutitire2

Untitled

Jun 13th, 2020
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.25 KB | None | 0 0
  1. Variables:
  2. {r.mem::*} = 0
  3. {b.mem::*} = 0
  4. {tfb.rsp} = 0
  5. {tfb.rp} = 0
  6. {tfb.bsp} = 0
  7. {tfb.bp} = 0
  8. {%player%.tfbj} = 0
  9. {tfb.st} = 0
  10. {tfb.timer} = 0
  11. {tfb.plx} = 0
  12. {tfb.ply} = 0
  13. {tfb.plz} = 0
  14. command /tfbsp <int> [<int>] [<int>] [<int>]:
  15. permission: skript.admin
  16. trigger:
  17. if arg 1 is 1:
  18. set {tfb.rsp} to player's location
  19. if arg 1 is 2:
  20. set {tfb.bsp} to player's location
  21. if arg 1 is 3:
  22. set {tfb.plx} to arg 2
  23. set {tfb.ply} to arg 3
  24. set {tfb.plz} to arg 4
  25.  
  26. command /tfb <text> [<player>]:
  27. trigger:
  28. if arg 1 is "reset":
  29. set {tfbct} to 0
  30. loop size of {r.mem::*} times:
  31. set {%{r.mem::%{tfbct}%}%.tfbj} to 0
  32. set {tfbct} to {tfbct} + 1
  33. set {%{r.mem::%{tfbct}%}%.tfbj} to 0
  34. set {tfbct} to 0
  35. loop size of {b.mem::*} times:
  36. set {%{b.mem::%{tfbct}%}%.tfbj} to 0
  37. set {tfbct} to {tfbct} + 1
  38. set {%{b.mem::%{tfbct}%}%.tfbj} to 0
  39. delete {r.mem::*}
  40. delete {b.mem::*}
  41. set {tfb.bp} to 0
  42. set {tfb.rp} to 0
  43. set {%arg 2%.tfbj} to 0
  44. set {tfb.st} to 0
  45. set {tfb.timer} to 0
  46. if arg 1 is "begin":
  47. if {tfb.st} is not 0:
  48. message "既に始まっています!"
  49. if {tfb.st} is 0:
  50. set {tfb.st} to 1
  51. broadcast "&6&l占領チーム戦&b&lが始まります!&a&l/tfb joinしよう!"
  52.  
  53. if arg 1 is "join":
  54. if {tfb.st} is 1:
  55. if size of {r.mem::*} is size of {b.mem::*}:
  56. if {%player%.tfbj} is not 0:
  57. message "You already joined"
  58. if {%player%.tfbj} is 0:
  59. add player to {r.mem::*}
  60. set {%player%.tfbj} to 1
  61. broadcast "%player% さんが赤チームに入りました!"
  62. if size of {r.mem::*} is more than size of {b.mem::*}:
  63. if {%player%.tfbj} is not 0:
  64. message "You already joined"
  65. if {%player%.tfbj} is 0:
  66. add player to {b.mem::*}
  67. set {%player%.tfbj} to 1
  68. broadcast "%player% さんが青チームに入りました!"
  69. if size of {r.mem::*} is less than size of {b.mem::*}:
  70. if {%player%.tfbj} is 0:
  71. add player to {r.mem::*}
  72. set {%player%.tfbj} to 1
  73. if {%player%.tfbj} is not 0:
  74. message "You already joined"
  75.  
  76. every seconds:
  77. if {tfb.st} is 1:
  78. set {tfb.timer} to {tfb.timer} + 1
  79. if {tfb.timer} is more than 120:
  80. broadcast "ゲームが始まりますよ!"
  81. {tblue::*}
  82. {tred::*}
  83. set {tfbct} to 0
  84. loop size of {b.mem::*} times:
  85. teleport {b.mem::%{tfbct}%} to {tfb.bsp}
  86. set {tfbct} to {tfbct} + 1
  87. teleport {b.mem::%{tfbct}%} to {tfb.bsp}
  88. set {tfbct} to 0
  89. loop size of {r.mem::*} times:
  90. teleport {r.mem::%{tfbct}%} to {tfb.rsp}
  91. set {tfbct} to {tfbct} + 1
  92. teleport {r.mem::%{tfbct}%} to {tfb.rsp}
  93. set {tfb.st} to 2
  94. set {tfb.timer} to 0
  95. if {tfb.st} is 2:
  96. set {tfb.timer} to {tfb.timer} + 1
  97. loop all players:
  98. if block below loop-player is wool:
  99. if {r.mem::*} contains loop-player:
  100. set {tfb.rp} to {tfb.rp} + 1
  101. set {_tfb.wr} to 1
  102. execute console command "/setblock %{tfb.plx}% %{tfb.ply}% %{tfb.plz}% wool 14"
  103. if {b.mem::*} contains loop-player:
  104. set {tfb.bp} to {tfb.bp} + 1
  105. set {_tfb.wb} to 1
  106. execute console command "/setblock %{tfb.plx}% %{tfb.ply}% %{tfb.plz}% wool 3"
  107. if {_tfb.wr} is 0:
  108. if {_tfb.wb} is 0:
  109. execute console command "/setblock %{tfb.plx}% %{tfb.ply}% %{tfb.plz}% wool 0"
  110. set {tps} to {tfb.rp} + {tfb.bp}
  111. set {atps} to 100 / {tps}
  112. set {rps} to {tfb.bp} * {atps}
  113. set {bps} to {tfb.rp} * {atps}
  114. send action bar "&c&l%{tfb.rp}%■■■■■■■■■■&b&l%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  115. if {rps} is more than 0:
  116. if {rps} is less than 10:
  117. send action bar "&c&l%{tfb.rp}%■■■■■■■■■&b&l■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  118. if {rps} is more than 10:
  119. if {rps} is less than 20:
  120. send action bar "&c&l%{tfb.rp}%■■■■■■■■&b&l■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  121. if {rps} is more than 20:
  122. if {rps} is less than 30:
  123. send action bar "&c&l%{tfb.rp}%■■■■■■■&b&l■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  124. if {rps} is more than 30:
  125. if {rps} is less than 40:
  126. send action bar "&c&l%{tfb.rp}%■■■■■■&b&l■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  127. if {rps} is more than 40:
  128. if {rps} is less than 50:
  129. send action bar "&c&l%{tfb.rp}%■■■■■&b&l■■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  130. if {rps} is more than 50:
  131. if {rps} is less than 60:
  132. send action bar "&c&l%{tfb.rp}%■■■■&b&l■■■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  133. if {rps} is more than 60:
  134. if {rps} is less than 70:
  135. send action bar "&c&l%{tfb.rp}%■■■&b&l■■■■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  136. if {rps} is more than 70:
  137. if {rps} is less than 80:
  138. send action bar "&c&l%{tfb.rp}%■■&b&l■■■■■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  139. if {rps} is more than 80:
  140. if {rps} is less than 90:
  141. send action bar "&c&l%{tfb.rp}%■&b&l■■■■■■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  142. if {rps} is more than 90:
  143. if {rps} is less than 100:
  144. send action bar "&c&l%{tfb.rp}%&b&l■■■■■■■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  145. if {rps} is 100:
  146. send action bar "&c&l%{tfb.rp}%&b&l■■■■■■■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  147.  
  148. if {tfb.timer} is 300:
  149. if {tfb.rp} is more than {tfb.bp}:
  150. broadcast "終了です! 結果は... &a&l青%{tfb.bp}% &c&l赤%{tfb.rp}% &aよって、赤の勝ちです! /sp で戻ってね!"
  151. if {tfb.rp} is less than {tfb.bp}:
  152. broadcast "終了です! 結果は... &a&l青%{tfb.bp}% &c&l赤%{tfb.rp}% &aよって、青の勝ちです! /sp で戻ってね!"
  153. if {tfb.rp} is {tfb.bp}:
  154. broadcast "終了です! 結果は... &a&l青%{tfb.bp}% &c&l赤%{tfb.rp}% &aよって、引き分けです! /sp で戻ってね!"
  155. set {tfbct} to 0
  156. loop size of {r.mem::*} times:
  157. set {%{r.mem::%{tfbct}%}%.tfbj} to 0
  158. set {tfbct} to {tfbct} + 1
  159. set {%{r.mem::%{tfbct}%}%.tfbj} to 0
  160. set {tfbct} to 0
  161. loop size of {b.mem::*} times:
  162. set {%{b.mem::%{tfbct}%}%.tfbj} to 0
  163. set {tfbct} to {tfbct} + 1
  164. set {%{b.mem::%{tfbct}%}%.tfbj} to 0
  165. delete {r.mem::*}
  166. delete {b.mem::*}
  167. set {tfb.bp} to 0
  168. set {tfb.rp} to 0
  169. set {tfb.st} to 0
  170.  
  171. On death:
  172. while victim is not alive:
  173. wait 1 seconds
  174. if {tfb.st} is 2:
  175. if {b.mem::*} contains victim:
  176. teleport victim to {tfb.bsp}
  177. if {r.mem::*} contains victim:
  178. teleport victim to {tfb.rsp}
  179. On damage:
  180. if {r.mem::*} contains victim:
  181. if {r.mem::*} contains attacker:
  182. cancel event
  183. if {b.mem::*} contains victim:
  184. if {b.mem::*} contains attacker:
  185. cancel event
  186. On death:
  187. if {b.mem::*} contains attacker:
  188. set {tfb.bp} to {tfb.bp} + 2
  189. if {r.mem::*} contains attacker:
  190. set {tfb.bp} to {tfb.bp} + 2
Add Comment
Please, Sign In to add comment