CREAMPAN0408

Untitled

Feb 3rd, 2019
41
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%> %message%" to loop-player
  41.  
  42. on break:
  43.  
  44.   if location of event-block is {bluecore}:
  45.     {team.%player%} is red
  46.     remove 1 from {bluehp}
  47.     execute console command "/scoreboard players set Blue Core %{bluehp}%"
  48. #   execute console command "/displaycore"
  49.     wait 6 ticks
  50.     set block at location of event-block to anvil
  51.     if {bluehp} is smaller than 0:
  52.       message "<magenta>赤チームの勝利!"
  53.   if location of event-block is {redcore}:
  54.     {team.%player%} is blue
  55.     remove 1 from {redhp}
  56.     execute console command "/scoreboard players set Red Core %{redhp}%"
  57. #   execute console command "/displaycore"
  58.     wait 6 ticks
  59.     set block at location of event-block to anvil
  60.     if {redhp} is smaller than 0:
  61.       message "<magenta>青チームの勝利!"
  62.  
  63. on break:
  64.   distance between location of event-block and location of {bluecore} or {redcore} or {bluespawn} or {redspawn} is smaller than 5:
  65.     cancel event
  66.  
  67. on place:
  68.   distance between location of event-block and location of {bluecore} or {redcore} or {bluespawn} or {redspawn} is smaller than 5:
  69.     cancel event
  70.  
  71. on explode:
  72.   distance between location of the entity and location of {bluecore} or {redcore} or {bluespawn} or {redspawn} is smaller than 8:
  73.     cancel event
  74.  
  75. on rightclick on an anvil:
  76.   player has permission "Admin"
  77.   cancel event
  78.   execute console command "/scoreboard objectives add Core dummy"
  79.   if player is holding blue dye:
  80.     set {bluecore} to location of event-block
  81.     set {bluehp} to 100
  82.     execute console command "/scoreboard players set Blue Core %{bluehp}%"
  83.     message "青コアの位置を決定しました"
  84.   if player is holding red dye:
  85.     set {redcore} to location of event-block
  86.     set {redhp} to 100
  87.     execute console command "/scoreboard players set Red Core %{redhp}%"
  88.     message "赤コアの位置を決定しました"
  89.   if player is holding white dye:
  90.     if location of event-block is {bluecore}:
  91.       delete {bluecore}
  92.       message "青コアを削除しました"
  93.     if location of event-block is {redcore}:
  94.       delete {redcore}
  95.       message "赤コアを削除しました"
  96.  
  97. on rightclick on an beacon:
  98.  
  99.   player has permission "Admin"
  100.   if player is holding blue dye:
  101.     set {bluespawn} to location of event-block
  102.     message "青拠点の位置を決定しました"
  103.   if player is holding red dye:
  104.     set {redspawn} to location of event-block
  105.     message "赤拠点の位置を決定しました"
  106.   if player is holding white dye:
  107.     if location of event-block is {bluespawn}:
  108.       delete {blue.spawn}
  109.       message "青拠点を削除しました"
  110.     if location of event-block is {redspawn}:
  111.       delete {redspawn}
  112.       message "赤拠点を削除しました"
  113.  
  114. on rightclick with yellow dye:
  115.   player has permission "Admin"
  116.   if {bluecore} is not set:
  117.     message "青コアを設定してください"
  118.     stop
  119.   if {redcore} is not set:
  120.     message "赤コアを設定してください"
  121.     stop
  122.   message "<magenta>スタート!"
  123.   loop all players:
  124.   if {team.%loop-player%} is blue:
  125.     teleport loop-player to {bluespawn}
  126.   if {team.%loop-player%} is red:
  127.     teleport loop-player to {redspawn}
  128.  
  129. # loop all players:
  130. #   set name of sidebar of loop-player to "Core"
  131.  
  132.  
  133.  
  134. #command /displaycore:
  135. # trigger:
  136. #   loop all players:
  137. #     set name of sidebar of loop-player to "Core"
  138. #     set score "<bold><blue>Blue" in sidebar of loop-player to {bluehp}
  139. #     set score "<bold><red>Red" in sidebar of loop-player to {redhp}
Add Comment
Please, Sign In to add comment