Advertisement
NAOSAMA

Untitled

Feb 19th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.77 KB | None | 0 0
  1. command /team random:
  2.  
  3.   trigger:
  4.     set {_pnum} to 0
  5.     set {_lnum} to 0
  6.     delete {teamred::*}
  7.     delete {teamblue::*}
  8.     delete {teamwhite::*}
  9.     execute console command "/scoreboard teams empty red"
  10.     execute console command "/scoreboard teams empty blue"
  11.     execute console command "/scoreboard teams join red Red"
  12.     execute console command "/scoreboard teams join blue Blue"
  13.     loop all players:
  14.       add loop-player to {teamwhite::*}
  15.       add 1 to {_pnum}
  16.     loop {_pnum} times:
  17.       add 1 to {_lnum}
  18.       set {_random} to a random player out of {teamwhite::*}
  19.       remove {_random} from {teamwhite::*}
  20.       if {_lnum} is 1:
  21.         add {_random} to {teamred::*}
  22.         set {team.%{_random}%} to red
  23.         execute console command "/scoreboard teams join red %{_random}%"
  24.       else if {_lnum} is 2:
  25.         add {_random} to {teamblue::*}
  26.         set {team.%{_random}%} to blue
  27.         execute console command "/scoreboard teams join blue %{_random}%"
  28.         remove 2 from {_lnum}
  29.     message "<red>%{teamred::*}%<white>,<blue>%{teamblue::*}%"
  30.  
  31. on chat:
  32.   cancel event
  33.   if {team.%player%} is red:
  34.     loop all players:
  35.       if {team.%loop-player%} is red:
  36.         message "%message%" to loop-player
  37.   if {team.%player%} is blue:
  38.     loop all players:
  39.       if {team.%loop-player%} is blue:
  40.         message "<%player%>on break:
  41.  
  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 %message%" to loop-player
  72.  
  73. on rightclick on an anvil:
  74.   player has permission "Admin"
  75.   cancel event
  76.   execute console command "/scoreboard objectives add Core dummy"
  77.   if player is holding blue dye:
  78.     set {bluecore} to location of event-block
  79.     set {bluehp} to 100
  80.     execute console command "/scoreboard players set Blue Core %{bluehp}%"
  81.     message "青コアの位置を決定しました"
  82.   if player is holding red dye:
  83.     set {redcore} to location of event-block
  84.     set {redhp} to 100
  85.     execute console command "/scoreboard players set Red Core %{redhp}%"
  86.     message "赤コアの位置を決定しました"
  87.   if player is holding white dye:
  88.     if location of event-block is {bluecore}:
  89.       delete {bluecore}
  90.       message "青コアを削除しました"
  91.     if location of event-block is {redcore}:
  92.       delete {redcore}
  93.       message "赤コアを削除しました"
  94.  
  95. on rightclick on an beacon:
  96.  
  97.   player has permission "Admin"
  98.   if player is holding blue dye:
  99.     set {bluespawn} to location of event-block
  100.     message "青拠点の位置を決定しました"
  101.   if player is holding red dye:
  102.     set {redspawn} to location of event-block
  103.     message "赤拠点の位置を決定しました"
  104.   if player is holding white dye:
  105.     if location of event-block is {bluespawn}:
  106.       delete {blue.spawn}
  107.       message "青拠点を削除しました"
  108.     if location of event-block is {redspawn}:
  109.       delete {redspawn}
  110.       message "赤拠点を削除しました"
  111.  
  112. on rightclick with yellow dye:
  113.   player has permission "Admin"
  114.   if {bluecore} is not set:
  115.     message "青コアを設定してください"
  116.     stop
  117.   if {redcore} is not set:
  118.     message "赤コアを設定してください"
  119.     stop
  120.   message "<magenta>スタート!"
  121.   loop all players:
  122.   if {team.%loop-player%} is blue:
  123.     teleport loop-player to {bluespawn}
  124.   if {team.%loop-player%} is red:
  125.     teleport loop-player to {redspawn}
  126.  
  127. # loop all players:
  128. #   set name of sidebar of loop-player to "Core"
  129.  
  130.  
  131.  
  132. #command /displaycore:
  133. # trigger:
  134. #   loop all players:
  135. #     set name of sidebar of loop-player to "Core"
  136. #     set score "<bold><blue>Blue" in sidebar of loop-player to {bluehp}
  137. #     set score "<bold><red>Red" in sidebar of loop-player to {redhp}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement