Advertisement
CREAMPAN0408

Untitled

Feb 3rd, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.51 KB | None | 0 0
  1. command /team random:
  2. trigger:
  3. set {_pnum} to 0
  4. set {_lnum} to 0
  5. delete {teamred::*}
  6. delete {teamblue::*}
  7. delete {teamwhite::*}
  8. execute console command "/scoreboard teams empty red"
  9. execute console command "/scoreboard teams empty blue"
  10. execute console command "/scoreboard teams join red Red"
  11. execute console command "/scoreboard teams join blue Blue"
  12. loop all players:
  13. add loop-player to {teamwhite::*}
  14. add 1 to {_pnum}
  15. loop {_pnum} times:
  16. add 1 to {_lnum}
  17. set {_random} to a random player out of {teamwhite::*}
  18. remove {_random} from {teamwhite::*}
  19. if {_lnum} is 1:
  20. add {_random} to {teamred::*}
  21. set {team.%{_random}%} to red
  22. execute console command "/scoreboard teams join red %{_random}%"
  23. else if {_lnum} is 2:
  24. add {_random} to {teamblue::*}
  25. set {team.%{_random}%} to blue
  26. execute console command "/scoreboard teams join blue %{_random}%"
  27. remove 2 from {_lnum}
  28. message "<red>%{teamred::*}%<white>,<blue>%{teamblue::*}%"
  29.  
  30. on chat:
  31. cancel event
  32. if {team.%player%} is red:
  33. loop all players:
  34. if {team.%loop-player%} is red:
  35. message "%message%" to loop-player
  36. if {team.%player%} is blue:
  37. loop all players:
  38. if {team.%loop-player%} is blue:
  39. message "<%player%> %message%" to loop-player
  40.  
  41. on break:
  42. if location of event-block is {bluecore}:
  43. {team.%player%} is red
  44. remove 1 from {bluehp}
  45. execute console command "/scoreboard players set Blue Core %{bluehp}%"
  46. execute console command "/displaycore"
  47. wait 6 ticks
  48. set block at location of event-block to anvil
  49. if {bluehp} is smaller than 0:
  50. message "<magenta>赤チームの勝利!"
  51. if location of event-block is {redcore}:
  52. {team.%player%} is blue
  53. remove 1 from {redhp}
  54. execute console command "/scoreboard players set Red Core %{redhp}%"
  55. execute console command "/displaycore"
  56. wait 6 ticks
  57. set block at location of event-block to anvil
  58. if {redhp} is smaller than 0:
  59. message "<magenta>青チームの勝利!"
  60.  
  61. on break:
  62. distance between location of event-block and location of {bluecore} or {redcore} or {bluespawn} or {redspawn} is smaller than 5:
  63. cancel event
  64.  
  65. on place:
  66. distance between location of event-block and location of {bluecore} or {redcore} or {bluespawn} or {redspawn} is smaller than 5:
  67. cancel event
  68.  
  69. on explode:
  70. distance between location of the entity and location of {bluecore} or {redcore} or {bluespawn} or {redspawn} is smaller than 8:
  71. cancel event
  72.  
  73. on rightclick on an anvil:
  74. cancel event
  75. execute console command "/scoreboard objectives add Core dummy"
  76. if player is holding blue dye:
  77. set {bluecore} to location of event-block
  78. set {bluehp} to 100
  79. execute console command "/scoreboard players set Blue Core %{bluehp}%"
  80. message "青コアの位置を決定しました"
  81. if player is holding red dye:
  82. set {redcore} to location of event-block
  83. set {redhp} to 100
  84. execute console command "/scoreboard players set Red Core %{redhp}%"
  85. message "赤コアの位置を決定しました"
  86. if player is holding white dye:
  87. if location of event-block is {bluecore}:
  88. delete {bluecore}
  89. message "青コアを削除しました"
  90. if location of event-block is {redcore}:
  91. delete {redcore}
  92. message "赤コアを削除しました"
  93.  
  94. on rightclick on an beacon:
  95. if player is holding blue dye:
  96. set {bluespawn} to location of event-block
  97. message "青拠点の位置を決定しました"
  98. if player is holding red dye:
  99. set {redspawn} to location of event-block
  100. message "赤拠点の位置を決定しました"
  101. if player is holding white dye:
  102. if location of event-block is {bluespawn}:
  103. delete {blue.spawn}
  104. message "青拠点を削除しました"
  105. if location of event-block is {redspawn}:
  106. delete {redspawn}
  107. message "赤拠点を削除しました"
  108.  
  109. on rightclick with yellow dye:
  110. if {bluecore} is not set:
  111. message "青コアを設定してください"
  112. stop
  113. if {redcore} is not set:
  114. message "赤コアを設定してください"
  115. stop
  116. message "<magenta>スタート!"
  117. loop all players:
  118. if {team.%loop-player%} is blue:
  119. teleport loop-player to {bluespawn}
  120. if {team.%loop-player%} is red:
  121. teleport loop-player to {redspawn}
  122.  
  123. loop all players:
  124. set name of sidebar of loop-player to "Core"
  125.  
  126. command /displaycore:
  127. trigger:
  128. loop all players:
  129. set name of sidebar of loop-player to "Core"
  130. set score "<bold><blue>Blue" in sidebar of loop-player to {bluehp}
  131. set score "<bold><red>Red" in sidebar of loop-player to {redhp}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement