Advertisement
siso_

build battle

Jun 2nd, 2019
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.58 KB | None | 0 0
  1. options:
  2. s: BuildBattle
  3.  
  4. command /start:
  5. permission: siso
  6. trigger:
  7. if {game} is true:
  8. send "&c既に開始されています"
  9. stop
  10. set {game} to true
  11. set {timers} to "&610 minutes"
  12. broadcast "{@s} ゲームを開始します"
  13. wait 3 seconds
  14. loop all players:
  15. if {nojoin.%loop-player%} is "on":
  16. send "&cあなたは今回のゲームには参加しません" to loop-player
  17. else:
  18. add loop-player to {allplayer::*}
  19. add loop-player to {member::*}
  20. if {member::*} is not set:
  21. broadcast "{@s} &cゲームを開始できません"
  22. wait 3 seconds
  23. execute console command "/stopgame"
  24. stop
  25. if size of {member::*} <= 1:
  26. broadcast "{@s} &cゲームを開始できません"
  27. wait 3 seconds
  28. execute console command "/stopgame"
  29. stop
  30. loop {allplayer::*}:
  31. clear loop-value's inventory
  32. spawn(loop-value)
  33. rs(loop-value)
  34. rs(all players)
  35. broadcast "{@s} ゲームが開始されました。"
  36. timelimit()
  37. stop
  38.  
  39. command /stopgame:
  40. permission: siso
  41. trigger:
  42. broadcast "{@s} ゲームを終了しました"
  43. set {game} to false
  44. delete {timea0}
  45. delete {timea1}
  46. delete {timea2}
  47. delete {timea3}
  48. delete {timea4}
  49. delete {timea5}
  50. delete {timea.half}
  51. delete {spawnnum}
  52. delete {time.%{timenum}%}
  53. loop {allplayer::*}:
  54. teleport loop-value to {lobby}
  55. clear loop-value's inventory
  56. add 100 to loop-value's health
  57. set loop-value's gamemode to adventure
  58. execute console command "/effect @a clear"
  59. lvup(loop-value)
  60. rs(loop-value)
  61. execute console command "/kill @e[type=item]"
  62. delete {allplayer::*}
  63. delete {member::*}
  64. rs(all players)
  65. if {re} is true:
  66. broadcast "{@s} 30秒後に再スタートします"
  67. wait 30 seconds
  68. execute console command "/start"
  69. stop
  70.  
  71. every tick:
  72. if {time.%{timenum}%} is set:
  73. floor(unix timestamp of now) = {time.%{timenum}%} - 300: #5
  74. if {timea5} is not set:
  75. set {timea5} to true
  76. broadcast "{@s} 残り2分"
  77. floor(unix timestamp of now) = {time.%{timenum}%} - 240:
  78. if {timea4} is not set:
  79. set {timea4} to true
  80. broadcast "{@s} 残り4分"
  81. floor(unix timestamp of now) = {time.%{timenum}%} - 180: #3
  82. if {timea3} is not set:
  83. set {timea3} to true
  84. broadcast "{@s} 残り3分"
  85. floor(unix timestamp of now) = {time.%{timenum}%} - 120:
  86. if {timea2} is not set:
  87. set {timea2} to true
  88. broadcast "{@s} 残り2分"
  89. floor(unix timestamp of now) = {time.%{timenum}%} - 60: #1
  90. if {timea1} is not set:
  91. set {timea1} to true
  92. broadcast "{@s} 残り1分"
  93. floor(unix timestamp of now) = {time.%{timenum}%} - 30:
  94. if {timea.half} is not set:
  95. set {timea.half} to true
  96. broadcast "{@s} 残り30秒"
  97. if floor(unix timestamp of now) >= {time.%{timenum}%}:
  98. broadcast "{@s} 投票に移行します"
  99. add 1 to {spawnnum}
  100. loop {allplayer::*}:
  101. set {vote.%loop-value%} to true
  102. remove 1 from {spawnnum}
  103. vote()
  104.  
  105. function vote():
  106. loop size of {allplayer::*} times:
  107. add 1 to {votenum}
  108. add 1 to {spawnnum}
  109. set {voted} to {votenum}
  110. loop {allplayer::*}:
  111. teleport loop-value-2 to {spawn.%{spawnnum}%}
  112. wait 7 seconds
  113. execute console command "/playsound ui.button.click master @a ~ ~ ~ 2 1 1"
  114. wait 1 seconds
  115. execute console command "/playsound ui.button.click master @a ~ ~ ~ 2 1 1"
  116. wait 1 seconds
  117. execute console command "/playsound ui.button.click master @a ~ ~ ~ 2 1 1"
  118. wait 1 seconds
  119. ranking()
  120. on rightclick:
  121. {voted} is true
  122. if item is red wool:
  123. if {alreday.%{spawnnum}%.%player%} is true:
  124. send "既に投票しています"
  125. stop
  126. add 0 to {point::%{votemap.%{spawnnum}%}%}
  127. set {alreday.%{spawnnum}%.%player%} to true
  128. send "Selected PooP"
  129. stop
  130. if item is light green wool:
  131. if {alreday.%{spawnnum}%.%player%} is true:
  132. send "既に投票しています"
  133. stop
  134. add 1 to {point::%{votemap.%{spawnnum}%}%}
  135. set {alreday.%{spawnnum}%.%player%} to true
  136. send "You selected OK"
  137. stop
  138. if item is green wool:
  139. if {alreday.%{spawnnum}%.%player%} is true:
  140. send "既に投票しています"
  141. stop
  142. add 2 to {point::%{votemap.%{spawnnum}%}%}
  143. set {alreday.%{spawnnum}%.%player%} to true
  144. send "You selected Good"
  145. stop
  146. if item is purple wool:
  147. if {alreday.%{spawnnum}%.%player%} is true:
  148. send "既に投票しています"
  149. stop
  150. add 3 to {point::%{votemap.%{spawnnum}%}%}
  151. set {alreday.%{spawnnum}%.%player%} to true
  152. send "You selected Epic"
  153. stop
  154. if item is orange wool:
  155. if {alreday.%{spawnnum}%.%player%} is true:
  156. send "既に投票しています"
  157. stop
  158. add 4 to {point::%{votemap.%{spawnnum}%}%}
  159. set {alreday.%{spawnnum}%.%player%} to true
  160. send "You selected Legendary"
  161. stop
  162.  
  163. function timelimit():
  164. if {time.%{timenum}%} is not set:
  165. add 1 to {timenum}
  166. set {time.%{timenum}%} to floor(unix timestamp of now) + 300
  167. if {time.%{timenum}%} is set:
  168. delete {time.%{timenum}%}
  169. add 1 to {timenum}
  170. set {time.%{timenum}%} to floor(unix timestamp of now) + 300
  171. else:
  172. send "&cTime limit Error &5Unixnow%floor(unix timestamp of now)% &6%{time.%{timenum}%}%" to ops
  173.  
  174. function spawn(p: player):
  175. add 1 to {spawnnum}
  176. teleport {_p} to {spawn.%{spawnnum}%}
  177. set {votemap.%{spawnnum}%} to {_p}
  178.  
  179.  
  180. function rs(p: player):
  181. if {game} is true:
  182. wipe {_p}'s sidebar
  183. set name of sidebar of {_p} to "&6MCSG"
  184. set score "&6&lSisoPixel" in sidebar of {_p} to 1
  185. set score "" in sidebar of {_p} to 2
  186. set score "" in sidebar of {_p} to 3
  187. set score "&a&l%{players}%&7/15" in sidebar of {_p} to 4
  188. set score "Players:" in sidebar of {_p} to 5
  189. set score "" in sidebar of {_p} to 6
  190. set score "&6&l%{timers}%" in sidebar of {_p} to 7
  191. set score "Timelimit:" in sidebar of {_p} to 8
  192. set score "" in sidebar of {_p} to 9
  193. set score "&a&l%{theme}%" in sidebar of {_p} to 10
  194. set score "お題:" in sidebar of {_p} to 11
  195. set score "" in sidebar of {_p} to 12
  196. stop
  197. else:
  198. wipe {_p}'s sidebar
  199. set name of sidebar of {_p} to "&e&lしその鯖"
  200. set score "&6&lSisoPixel" in sidebar of {_p} to 1
  201. set score "" in sidebar of {_p} to 2
  202. set score "Lv: &b&l%{lv.%{_p}%}%" in sidebar of {_p} to 3
  203. set score "XP: &a&l%{xp.%{_p}%}%" in sidebar of {_p} to 4
  204. set score "Kills: &c&l%{kill.%{_p}%}%" in sidebar of {_p} to 5
  205. set score "&b===Your Status===" in sidebar of {_p} to 6
  206. set score "" in sidebar of {_p} to 7
  207.  
  208. function lvup(p: player):
  209. set {_p} tab name to "&6&l[&a&lLv%{lv.%{_p}%}%&6&l] &f%{_p}%"
  210. if {lv.%{_p}%} >= 20:
  211. set {_p} tab name to "&6&l[&b&lLv%{lv.%{_p}%}%&6&l] &f%{_p}%"
  212. if {lv.%{_p}%} >= 30:
  213. set {_p} tab name to "&6&l[&3&lLv%{lv.%{_p}%}%&6&l] &f%{_p}%"
  214. if {lv.%{_p}%} >= 50:
  215. set {_p} tab name to "&6&l[&d&lLv%{lv.%{_p}%}%&6&l] &f%{_p}%"
  216. while {xp.%{_p}%} >= {nextlv.%{_p}%}:
  217. wait 2.5 tick
  218. play sound "entity.player.levelup" with volume 0.8 and pitch 0.7 at {_p} for {_p}
  219. set {nextlv.%{_p}%} to {nextlv.%{_p}%} * 1.1
  220. add 1 to {lv.%{_p}%}
  221. send "&aLvUP!! &l%{lv.%{_p}%}%Lv" to {_p}
  222. set {send.%{_p}%} to true
  223. if {send.%{_p}%} is true:
  224. send "&6次のレベルまで &5&l""%{nextlv.%{_p}%}%XP""" to {_p}
  225. set {_p} tab name to "&6&l[&a&lLv%{lv.%{_p}%}%&6&l] &f%{_p}%"
  226. set {send.%{_p}%} to false
  227.  
  228. function ranking():
  229. set {_high} to 0
  230. loop {ranking::*}:
  231. set {_list::%loop-index%} to loop-value
  232. loop 15 times:
  233. loop {_list::*}:
  234. loop-value-2 > {_high}
  235. set {_high} to loop-value-2
  236. set {_highplayer} to loop-index
  237. broadcast "&6%loop-number%&f:&e%{_highplayer}% &a%{_high}%&6Point"
  238. set {_high} to 0
  239. delete {_list::%{_highplayer}%}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement