Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- command /team random:
- trigger:
- set {_pnum} to 0
- set {_lnum} to 0
- delete {teamred::*}
- delete {teamblue::*}
- delete {teamwhite::*}
- execute console command "/scoreboard teams empty red"
- execute console command "/scoreboard teams empty blue"
- execute console command "/scoreboard teams join red Red"
- execute console command "/scoreboard teams join blue Blue"
- loop all players:
- add loop-player to {teamwhite::*}
- add 1 to {_pnum}
- loop {_pnum} times:
- add 1 to {_lnum}
- set {_random} to a random player out of {teamwhite::*}
- remove {_random} from {teamwhite::*}
- if {_lnum} is 1:
- add {_random} to {teamred::*}
- set {team.%{_random}%} to red
- execute console command "/scoreboard teams join red %{_random}%"
- else if {_lnum} is 2:
- add {_random} to {teamblue::*}
- set {team.%{_random}%} to blue
- execute console command "/scoreboard teams join blue %{_random}%"
- remove 2 from {_lnum}
- message "<red>%{teamred::*}%<white>,<blue>%{teamblue::*}%"
- on chat:
- cancel event
- if {team.%player%} is red:
- loop all players:
- if {team.%loop-player%} is red:
- message "%message%" to loop-player
- if {team.%player%} is blue:
- loop all players:
- if {team.%loop-player%} is blue:
- message "<%player%> %message%" to loop-player
Add Comment
Please, Sign In to add comment