TE1TO9_

Untitled

Apr 27th, 2019
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.75 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
Add Comment
Please, Sign In to add comment