fleft17

Untitled

Jul 4th, 2014
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. options:
  2. P: &8[&bCaptains&8]&r
  3.  
  4.  
  5. command /captains [<text>] [<integer>] [<text>]:
  6. permission: skript.op
  7. trigger:
  8. if arg-1 is "set":
  9. arg-2 is set:
  10. command sender is op:
  11. command sender command "/team reset"
  12. delete {_PosCaptains::*}
  13. delete {Captains::*}
  14. delete {_TempCaptains::*}
  15. wait 0.1 seconds
  16. set {_cTeamAmount} to arg-2
  17. loop all players:
  18. add loop-player to {_PosCaptains::*}
  19. loop {_cTeamAmount} times:
  20. add (random element out of {_PosCaptains::*}) to {_TempCaptains::*}
  21. set {Captains::*} to {_TempCaptains::*}
  22. set {chooseCaptains::*} to {_TempCaptains::*}
  23. remove {Captains::*} from {_PosCaptains::*}
  24. set {_TeamCount} to 0
  25. loop {_cTeamAmount} times:
  26. add 1 to {_TeamCount}
  27. command sender command "/team create %{_TeamCount}%"
  28. set {_Captain} to (random element out of {_TempCaptains::*})
  29. command sender command "/team join %{_TeamCount}% %{_Captain}%"
  30. remove {_Captain} from {_TempCaptains::*}
  31. wait 0.1 seconds
  32.  
  33. wait 0.1 second
  34. loop {Captains::*}:
  35. broadcast "{@P} Captain of Team &a%{Teams.InTeam::%loop-value%}%&r: &b%loop-value%"
  36. set {isCaptain.%loop-value%} to true
  37.  
  38.  
  39.  
  40. if arg-1 is "reset":
  41. command sender is op:
  42. delete {_PosCaptains::*}
  43. delete {Captains::*}
  44. delete {_CaptainTeam}
  45. delete {_TeamCount}
  46. delete {_TempCaptains::*}
  47. broadcast "{@P} Captains reset!"
  48.  
  49.  
  50. if arg-1 is "choosing":
  51. command sender is op:
  52. set {_pickingCaptain} to (random element out of {chooseCaptains::*})
  53. remove {_pickingCaptain} from {chooseCaptains::*}
  54. set {isChoosing.%{_pickingCaptain}%} to true
  55. broadcast "{@P} %{_pickingCaptain}% is picking!"
Advertisement
Add Comment
Please, Sign In to add comment