tsutitire2

Shooting Game

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