tsutitire2

Shooting Game

Jun 13th, 2020
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.27 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 arg 2 is not set:
  56. if size of {r.mem::*} is size of {b.mem::*}:
  57. if {%player%.tfbj} is not 0:
  58. message "You already joined"
  59. if {%player%.tfbj} is 0:
  60. add player to {r.mem::*}
  61. set {%player%.tfbj} to 1
  62. broadcast "%player% さんが赤チームに入りました!"
  63. if size of {r.mem::*} is more than size of {b.mem::*}:
  64. if {%player%.tfbj} is not 0:
  65. message "You already joined"
  66. if {%player%.tfbj} is 0:
  67. add player to {b.mem::*}
  68. set {%player%.tfbj} to 1
  69. broadcast "%player% さんが青チームに入りました!"
  70. if size of {r.mem::*} is less than size of {b.mem::*}:
  71. if {%player%.tfbj} is 0:
  72. add player to {r.mem::*}
  73. set {%player%.tfbj} to 1
  74. if {%player%.tfbj} is not 0:
  75. message "You already joined"
  76. if arg 2 is set:
  77. if size of {r.mem::*} is size of {b.mem::*}:
  78. if {%arg 2%.tfbj} is not 0:
  79. message "You already joined"
  80. if {%arg 2%.tfbj} is 0:
  81. add arg 2 to {r.mem::*}
  82. set {%arg 2%.tfbj} to 1
  83. broadcast "%arg 2% さんが赤チームに入りました!"
  84. if size of {r.mem::*} is more than size of {b.mem::*}:
  85. if {%arg 2%.tfbj} is not 0:
  86. message "You already joined"
  87. if {%arg 2%.tfbj} is 0:
  88. add arg 2 to {b.mem::*}
  89. set {%arg 2%.tfbj} to 1
  90. broadcast "%arg 2% さんが青チームに入りました!"
  91. if size of {r.mem::*} is less than size of {b.mem::*}:
  92. if {%arg 2%.tfbj} is 0:
  93. add arg 2 to {r.mem::*}
  94. set {%arg 2%.tfbj} to 1
  95. if {%arg 2%.tfbj} is not 0:
  96. message "You already joined"
  97. every seconds:
  98. if {tfb.st} is 1:
  99. set {tfb.timer} to {tfb.timer} + 1
  100. if {tfb.timer} is more than 120:
  101. broadcast "ゲームが始まりますよ!"
  102. loop all players:
  103. remove loop-player from {tblue::*}
  104. remove loop-player from {tred::*}
  105. set {tfbct} to 0
  106. loop size of {b.mem::*} times:
  107. teleport {b.mem::%{tfbct}%} to {tfb.bsp}
  108. set {tfbct} to {tfbct} + 1
  109. teleport {b.mem::%{tfbct}%} to {tfb.bsp}
  110. set {tfbct} to 0
  111. loop size of {r.mem::*} times:
  112. teleport {r.mem::%{tfbct}%} to {tfb.rsp}
  113. set {tfbct} to {tfbct} + 1
  114. teleport {r.mem::%{tfbct}%} to {tfb.rsp}
  115. set {tfb.st} to 2
  116. set {tfb.timer} to 0
  117. if {tfb.st} is 2:
  118. broadcast "メンバーは &c&l%{r.mem::*}% &b&l%{b.mem::*}%"
  119. set {tfb.timer} to {tfb.timer} + 1
  120. loop all players:
  121. if block below loop-player is wool:
  122. if {r.mem::*} contains loop-player:
  123. set {tfb.rp} to {tfb.rp} + 1
  124. set {_tfb.wr} to 1
  125. execute console command "/setblock %{tfb.plx}% %{tfb.ply}% %{tfb.plz}% wool 14"
  126. if {b.mem::*} contains loop-player:
  127. set {tfb.bp} to {tfb.bp} + 1
  128. set {_tfb.wb} to 1
  129. execute console command "/setblock %{tfb.plx}% %{tfb.ply}% %{tfb.plz}% wool 3"
  130. if {_tfb.wr} is 0:
  131. if {_tfb.wb} is 0:
  132. execute console command "/setblock %{tfb.plx}% %{tfb.ply}% %{tfb.plz}% wool 0"
  133. set {tps} to {tfb.rp} + {tfb.bp}
  134. set {atps} to 100 / {tps}
  135. set {rps} to {tfb.bp} * {atps}
  136. set {bps} to {tfb.rp} * {atps}
  137. send action bar "&c&l%{tfb.rp}%■■■■■■■■■■&b&l%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  138. if {rps} is more than 0:
  139. if {rps} is less than 10:
  140. send action bar "&c&l%{tfb.rp}%■■■■■■■■■&b&l■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  141. if {rps} is more than 10:
  142. if {rps} is less than 20:
  143. send action bar "&c&l%{tfb.rp}%■■■■■■■■&b&l■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  144. if {rps} is more than 20:
  145. if {rps} is less than 30:
  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. if {rps} is more than 30:
  148. if {rps} is less than 40:
  149. send action bar "&c&l%{tfb.rp}%■■■■■■&b&l■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  150. if {rps} is more than 40:
  151. if {rps} is less than 50:
  152. send action bar "&c&l%{tfb.rp}%■■■■■&b&l■■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  153. if {rps} is more than 50:
  154. if {rps} is less than 60:
  155. send action bar "&c&l%{tfb.rp}%■■■■&b&l■■■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  156. if {rps} is more than 60:
  157. if {rps} is less than 70:
  158. send action bar "&c&l%{tfb.rp}%■■■&b&l■■■■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  159. if {rps} is more than 70:
  160. if {rps} is less than 80:
  161. send action bar "&c&l%{tfb.rp}%■■&b&l■■■■■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  162. if {rps} is more than 80:
  163. if {rps} is less than 90:
  164. send action bar "&c&l%{tfb.rp}%■&b&l■■■■■■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  165. if {rps} is more than 90:
  166. if {rps} is less than 100:
  167. send action bar "&c&l%{tfb.rp}%&b&l■■■■■■■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  168. if {rps} is 100:
  169. send action bar "&c&l%{tfb.rp}%&b&l■■■■■■■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
  170.  
  171. if {tfb.timer} is 300:
  172. if {tfb.rp} is more than {tfb.bp}:
  173. broadcast "終了です! 結果は... &a&l青%{tfb.bp}% &c&l赤%{tfb.rp}% &aよって、赤の勝ちです! /sp で戻ってね!"
  174. if {tfb.rp} is less than {tfb.bp}:
  175. broadcast "終了です! 結果は... &a&l青%{tfb.bp}% &c&l赤%{tfb.rp}% &aよって、青の勝ちです! /sp で戻ってね!"
  176. if {tfb.rp} is {tfb.bp}:
  177. broadcast "終了です! 結果は... &a&l青%{tfb.bp}% &c&l赤%{tfb.rp}% &aよって、引き分けです! /sp で戻ってね!"
  178. set {tfbct} to 0
  179. loop size of {r.mem::*} times:
  180. set {%{r.mem::%{tfbct}%}%.tfbj} to 0
  181. set {tfbct} to {tfbct} + 1
  182. set {%{r.mem::%{tfbct}%}%.tfbj} to 0
  183. set {tfbct} to 0
  184. loop size of {b.mem::*} times:
  185. set {%{b.mem::%{tfbct}%}%.tfbj} to 0
  186. set {tfbct} to {tfbct} + 1
  187. set {%{b.mem::%{tfbct}%}%.tfbj} to 0
  188. delete {r.mem::*}
  189. delete {b.mem::*}
  190. set {tfb.bp} to 0
  191. set {tfb.rp} to 0
  192. set {tfb.st} to 0
  193. set {tfb.timer} to 0
  194.  
  195. On death:
  196. while victim is not alive:
  197. wait 1 seconds
  198. if {tfb.st} is 2:
  199. if {b.mem::*} contains victim:
  200. teleport victim to {tfb.bsp}
  201. if {r.mem::*} contains victim:
  202. teleport victim to {tfb.rsp}
  203. On damage:
  204. if {r.mem::*} contains victim:
  205. if {r.mem::*} contains attacker:
  206. cancel event
  207. if {b.mem::*} contains victim:
  208. if {b.mem::*} contains attacker:
  209. cancel event
  210. On death:
  211. if {b.mem::*} contains attacker:
  212. set {tfb.bp} to {tfb.bp} + 2
  213. if {r.mem::*} contains attacker:
  214. set {tfb.bp} to {tfb.bp} + 2
Add Comment
Please, Sign In to add comment