tsutitire2

Untitled

Jun 13th, 2020
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.64 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. if arg 1 is "begin":
  45. if {tfb.st} is 0:
  46. set {tfb.st} to 1
  47. broadcast "&6&l占領チーム戦&b&lが始まります!&a&l/tfb joinしよう!"
  48. if {tfb.st} is not 0:
  49. message "既に始まっています!"
  50. if arg 1 is "join":
  51. if {tfb.st} is 1:
  52. if size of {r.mem::*} is size of {b.mem::*}:
  53. if {%player%.tfbj} is 0:
  54. add player to {r.mem::*}
  55. set {%player%.tfbj} to 1
  56. if {%player%.tfbj} is not 0:
  57. message "You already joined"
  58. if size of {r.mem::*} is more than size of {b.mem::*}:
  59. if {%player%.tfbj} is 0:
  60. add player to {b.mem::*}
  61. set {%player%.tfbj} to 1
  62. if {%player%.tfbj} is not 0:
  63. message "You already joined"
  64. if size of {r.mem::*} is less than size of {b.mem::*}:
  65. if {%player%.tfbj} is 0:
  66. add player to {r.mem::*}
  67. set {%player%.tfbj} to 1
  68. if {%player%.tfbj} is not 0:
  69. message "You already joined"
  70.  
  71. every seconds:
  72. if {tfb.st} is 1:
  73. set {tfb.timer} to {tfb.timer} + 1
  74. if {tfb.st} is 120:
  75. broadcast "ゲームが始まりますよ!"
  76. set {tfbct} to 0
  77. loop size of {b.mem::*} times:
  78. teleport {b.mem::%{tfbct}%} to {tfb.bsp}
  79. set {tfbct} to {tfbct} + 1
  80. teleport {b.mem::%{tfbct}%} to {tfb.bsp}
  81. set {tfbct} to 0
  82. loop size of {r.mem::*} times:
  83. teleport {r.mem::%{tfbct}%} to {tfr.bsp}
  84. set {tfbct} to {tfbct} + 1
  85. teleport {r.mem::%{tfbct}%} to {tfr.bsp}
  86. set {tfb.st} to 2
  87. set {tfb.timer} to 0
  88. if {tfb.st} is 2:
  89. set {tfb.timer} to {tfb.timer} + 1
  90. loop all players:
  91. if block below loop-player is wool:
  92. if {r.mem::*} is contains loop-player:
  93. set {tfb.rp} to {tfb.rp} + 1
  94. set {_tfb.wr} to 1
  95. execute console command "/setblock %{tfb.plx}% %{tfb.ply}% %{tfb.plz}% wool 14"
  96. if {b.mem::*} is contains loop-player:
  97. set {tfb.bp} to {tfb.bp} + 1
  98. set {_tfb.wb} to 1
  99. execute console command "/setblock %{tfb.plx}% %{tfb.ply}% %{tfb.plz}% wool 3"
  100. if {_tfb.wr} is 0:
  101. if {_tfb.wb} is 0:
  102. execute console command "/setblock %{tfb.plx}% %{tfb.ply}% %{tfb.plz}% wool"
  103. {_tps} = {tfb.rp} + {tfb.bp}
  104. {_atps} = 100 / {_tps}
  105. {_rps} = {tfb.rp} * {_atps}
  106. {_bps} = {tfb.bp} * {_atps}
  107. if {_rps} is more than 0:
  108. if {_rps} is less than 10:
  109. send action bar "&c&l%{tfb.rp}%■■■■■■■■■&b&l■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  110. if {_rps} is more than 10:
  111. if {_rps} is less than 20:
  112. send action bar "&c&l%{tfb.rp}%■■■■■■■■&b&l■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  113. if {_rps} is more than 20:
  114. if {_rps} is less than 30:
  115. send action bar "&c&l%{tfb.rp}%■■■■■■■&b&l■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  116. if {_rps} is more than 30:
  117. if {_rps} is less than 40:
  118. send action bar "&c&l%{tfb.rp}%■■■■■■&b&l■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  119. if {_rps} is more than 40:
  120. if {_rps} is less than 50:
  121. send action bar "&c&l%{tfb.rp}%■■■■■&b&l■■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  122. if {_rps} is more than 50:
  123. if {_rps} is less than 60:
  124. send action bar "&c&l%{tfb.rp}%■■■■&b&l■■■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  125. if {_rps} is more than 60:
  126. if {_rps} is less than 70:
  127. send action bar "&c&l%{tfb.rp}%■■■&b&l■■■■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  128. if {_rps} is more than 70:
  129. if {_rps} is less than 80:
  130. send action bar "&c&l%{tfb.rp}%■■&b&l■■■■■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  131. if {_rps} is more than 80:
  132. if {_rps} is less than 90:
  133. send action bar "&c&l%{tfb.rp}%■&b&l■■■■■■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  134. if {_rps} is more than 90:
  135. if {_rps} is less than 100:
  136. send action bar "&c&l%{tfb.rp}%&b&l■■■■■■■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  137. if {_rps} is 100:
  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.  
  140.  
  141. if {tfb.st} is 300:
  142. if {tfb.rp} is more than {tfb.bp}:
  143. broadcast "終了です! 結果は... &a&l青%{tfb.bp}% &c&l赤%{tfb.rp}% &aよって、赤の勝ちです! /sp で戻ってね!"
  144. if {tfb.rp} is less than {tfb.bp}:
  145. broadcast "終了です! 結果は... &a&l青%{tfb.bp}% &c&l赤%{tfb.rp}% &aよって、青の勝ちです! /sp で戻ってね!"
  146. if {tfb.rp} is {tfb.bp}:
  147. broadcast "終了です! 結果は... &a&l青%{tfb.bp}% &c&l赤%{tfb.rp}% &aよって、引き分けです! /sp で戻ってね!"
  148. set {tfbct} to 0
  149. loop size of {r.mem::*} times:
  150. set {%{r.mem::%{tfbct}%}%.tfbj} to 0
  151. set {tfbct} to {tfbct} + 1
  152. set {%{r.mem::%{tfbct}%}%.tfbj} to 0
  153. set {tfbct} to 0
  154. loop size of {b.mem::*} times:
  155. set {%{b.mem::%{tfbct}%}%.tfbj} to 0
  156. set {tfbct} to {tfbct} + 1
  157. set {%{b.mem::%{tfbct}%}%.tfbj} to 0
  158. delete {r.mem::*}
  159. delete {b.mem::*}
  160. set {tfb.bp} to 0
  161. set {tfb.rp} to 0
  162.  
  163. On damage:
  164. if {r.mem::*} is contains victim:
  165. if {r.mem::*} is contains attacker:
  166. cancel event
  167. if {b.mem::*} is contains victim:
  168. if {b.mem::*} is contains attacker:
  169. cancel event
  170. On death:
  171. if {b.mem::*} is contains attacker:
  172. set {tfb.bp} to {tfb.bp} + 2
  173. if {r.mem::*} is contains attacker:
  174. set {tfb.bp} to {tfb.bp} + 2
Add Comment
Please, Sign In to add comment