Facebook
From Rude Motmot, 3 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 49
  1. command /team [<text>] [<text>]:
  2.         trigger:
  3.                 if arg-1 is "create":
  4.                         if {team.%player%} is not set:
  5.                                 if arg-2 is set:
  6.                                         if {team list::*} contains arg-2:
  7.                                                 send "&cName is taken"
  8.                                         else:
  9.                                                 set {team create date.%arg-2%} to now
  10.                                                 broadcast "%arg-2% team has been created"
  11.                                                 set {team.%player%} to arg-2
  12.                                                 set {team status.%arg-2%} to "Closed"
  13.                                                 send "&aCreated a team named &3%arg-2%"
  14.                                                 set {team owner.%arg-2%} to "%player%" parsed as player
  15.                                                 add player to {team members players.%arg-2%::*}
  16.                                                 add 1 to {team members.%arg-2%}
  17.                                                 add arg-2 to {team list::*}
  18.                                                 stop
  19.                         else:
  20.                                 send "&cLeave your current team to create one"
  21.                                 stop
  22.                 else if arg-1 is "list":
  23.                         set {_teams list::*} to {team list::*}
  24.                         set {_size} to size of {team list::*}
  25.                         loop {_size} times:
  26.                                 set {_team} to a random element out of {_teams list::*}
  27.                                 remove {_team} from {_teams list::*}
  28.                                 send "%{_team}%"
  29.                         stop
  30.                 else if arg-1 is "leave":
  31.                         if {team.%player%} is set:
  32.                                 if  {team owner.%{team.%player%}%} is player:
  33.                                         send "&cYou cant leave your own team"
  34.                                         send "&c/team delete to delete it"
  35.                                         stop
  36.                                 else:
  37.                                         loop {team members players.%{team.%player%}%::*}:
  38.                                                 if "%loop-value%" != "%player%":
  39.                                                         send "%player% left your team" to loop-value
  40.                                         remove 1 from {team members.%{team.%player%}%}
  41.                                         remove player from {team members.%{team.%player%}%}
  42.                                         send "&aLeft %{team.%player%}%"
  43.                                         delete {team.%player%}
  44.                                         stop
  45.                         else:
  46.                                 send "&cYou are not in a team" 
  47.                                 stop
  48.                 else if arg-1 is "chat":
  49.                         if {team.%player%} is set:
  50.                                 if {team chat.%player%} is true:
  51.                                         delete {team chat.%player%}
  52.                                         send " "
  53.                                         send "&a         Disabled team chat"
  54.                                         send " "
  55.                                         stop
  56.                                 else:
  57.                                         set {team chat.%player%} to true
  58.                                         send " "
  59.                                         send "&a         Enabled team chat"
  60.                                         send " "
  61.                                         stop
  62.                 else if arg-1 is "join":
  63.                         if arg-2 is set:
  64.                                 if {team.%player%} is not set:
  65.                                         if {team status.%arg-2%} is "Closed":
  66.                                                 send "&cteam is Closed"
  67.                                         else:
  68.                                                 set {team.%player%} to arg-2
  69.                                                 add player to {team members players.%arg-2%::*}
  70.                                                 add 1 to {team members.%arg-2%}
  71.                                                 send "&aJoined %arg-2%"
  72.                                                 loop {team members players.%{team.%player%}%::*}:
  73.                                                         if "%loop-value%" != "%player%":
  74.                                                                 send "%player% joined your team" to loop-value
  75.                                 else:
  76.                                         send "&cLeave you current team to join a new one"
  77.                 else if arg-1 is "delete":
  78.                         if {team.%player%} is set:
  79.                                 if {team owner.%{team.%player%}%} is player:
  80.                                         if {wanna delete.%{team.%player%}%} is set:
  81.                                                 broadcast "%{team.%player%}% has been disbanded"       
  82.                                                 delete {wanna delete.%{team.%player%}%}
  83.                                                 delete {team owner.%{team.%player%}%}
  84.                                                 delete {wanna delete cooldown.%{team.%player%}%}
  85.                                                 remove player from {team members players.%{team.%player%}%::*}
  86.                                                 loop {team members players.%{team.%player%}%::*}:
  87.                                                         delete {team.%loop-value%}
  88.                                                         send "Your team has been disbanded"
  89.                                                 delete {team members players.%{team.%player%}%::*}
  90.                                                 delete {team members.%{team.%player%}%}
  91.                                                 remove {team.%player%} from {team list::*}
  92.                                                 delete {team.%player%}
  93.                                         else:
  94.                                                 set {wanna delete.%{team.%player%}%} to true
  95.                                                 send "&c/team delete to confirm"
  96.                                                 set {wanna delete cooldown.%{team.%player%}%} to 10
  97.                                                 send "&cYou have 10 seconds"
  98.                                 else:
  99.                                         send "&cYou must be the team owner to delete the team"
  100.                 else if arg-1 is "kick":
  101.                         if {team members players.%{team.%player%}%::*} contains arg-2:
  102.                                 if {team.%player%} is set:
  103.                                         if {team owner.%{team.%player%}%} is player:
  104.                                                 set {_p} to arg-2 parsed as player
  105.                                                 send "&aKicked &e%arg-2% from &3%{team.%player%}%"
  106.                                                 remove arg-2 from {team members players.%{team.%player%}%::*}
  107.                                                 remove 1 from {team members.%{team.%player%}%}
  108.                                                 send "You have been kicked from %{team.%arg-2%}%" to {_p}
  109.                                                 delete {team.%arg-2%}
  110.                                         else:
  111.                                                 send "&cYou must be the team owner to kick players"
  112.                         else:
  113.                                 send "&c%arg-2% &cis not in your team"
  114.                 else if arg-1 is "invite":
  115.                         if arg-2 is set:
  116.                                 if {team owner.%{team.%player%}%} is player:
  117.                                         loop all players:
  118.                                                 add loop-player to {_players::*}
  119.                                         if {_players::*} contains arg-2:
  120.                                                 if {team.%arg-2%} is not set:
  121.                                                         set {_p} to arg-2 parsed as player
  122.                                                         set {invited to.%arg-2%} to {team.%player%}
  123.                                                         send "&aInvited %arg-2%"
  124.                                                         send "You have been invite to join %{team.%player%}%" to {_p}
  125.                                                         send "/team accept" to {_p}
  126.                                                         send "/team decline" to {_p}
  127.                                                 else:
  128.                                                         send "&c%arg-2% &cis in a team"
  129.                                         else:  
  130.                                                 send "&c%arg-2% &cis not online"       
  131.                                 else:
  132.                                         send "&cYou must be the team owner to invite people"
  133.                 else if arg-1 is "close":
  134.                         if {team owner.%{team.%player%}%} is player:
  135.                                 set {team status.%{team.%player%}%} to "Closed"
  136.                                 broadcast "%{team.%player%}% team has been closed"
  137.                                 send "Closed your team"
  138.                         else:
  139.                                 send "&cYou must be the team owner to change the team status"
  140.                 else if arg-1 is "open":
  141.                         if {team owner.%{team.%player%}%} is player:
  142.                                 set {team status.%{team.%player%}%} to "Open"
  143.                                 broadcast "%{team.%player%}% team has been opened"
  144.                                 send "Opened your team"
  145.                         else:
  146.                                 send "&cYou must be the team owner to change the team status"
  147.                 else if arg-1 is "accept":
  148.                         if {invited to.%player%} is set:
  149.                                 set {team.%player%} to {invited to.%player%}
  150.                                 add player to {team members players.%{invited to.%player%}%::*}
  151.                                 add 1 to {team members.%{invited to.%player%}%}
  152.                                 loop {team members players.%{team.%player%}%::*}:
  153.                                         if "%loop-value%" != "%player%":
  154.                                                 send "%player% joined your team" to loop-value
  155.                                 send "You joined %{team.%player%}%"
  156.                                 delete {invited to.%player%}
  157.                         else:
  158.                                 send "&cYou have no invites"
  159.                 else if arg-1 is "decline":
  160.                         if {invited to.%player%} is set:
  161.                                 send "&cDeclined the invite from %{invited to.%player%}%"
  162.                                 send "&c%player% &cdeclined your invite" to {team owner.%{invited to.%player%}%}
  163.                                 delete {invited to.%player%}
  164.                         else:
  165.                                 send "&cYou have no invites"
  166.                 else if arg-1 is "info":
  167.                         if arg-2 is set:
  168.                                 if {team list::*} contains arg-2:
  169.                                         send "&eName: &6%arg-2%"
  170.                                         send "&eMembers: &6%{team members.%arg-2%}%"
  171.                                         send "&eOwner: &6%{team owner.%arg-2%}%"
  172.                                         send "&eStatus: &6%{team status.%arg-2%}%"
  173.                                         send "&eMade On: &6%{team create date.%arg-2%}%"
  174.                                 else:
  175.                                         send "&c%arg-2% &cis not a team"
  176.                 else if arg-1 is "trust":
  177.                         if {team members players.%{team.%player%}%::*} contains arg-2:
  178.                                 if {team.%player%} is set:
  179.                                         if {team owner.%{team.%player%}%} is player:
  180.                                                 set {_p} to arg-2 parsed as player
  181.                                                 set {team trusted.%arg-2%} to true
  182.                                                 send "%arg-2% is now trused and can't be damaged"
  183.                                                 send "you are now trusted in your team" to {_p}
  184.                                         else:
  185.                                                 send "&cOnly the team owner can trust people"
  186.                         else:
  187.                                 send "&c%arg-2% &cis not in your team"
  188.                 else if arg-1 is "untrust":
  189.                         if {team members players.%{team.%player%}%::*} contains arg-2:
  190.                                 if {team.%player%} is set:
  191.                                         if {team owner.%{team.%player%}%} is player:
  192.                                                 set {_p} to arg-2 parsed as player
  193.                                                 delete {team trusted.%arg-2%}
  194.                                                 send "%arg-2% is no longer trused"
  195.                                                 send "you are no longer trusted in your team" to {_p}
  196.                                         else:
  197.                                                 send "&cOnly the team owner can trust people"
  198.                         else:
  199.                                 send "&c%arg-2% &cis not in your team"
  200.                 else if arg-1 is "help":
  201.                         send "/team delete - deletes the team"
  202.                         send "/team chat - this command you can toggle it off and on"
  203.                         send "/team create (team name ) - creates the team name"
  204.                         send "/team invite (player) - invites the player to the team"
  205.                         send "/team kick (player) kicks the player from the team"
  206.                         send "/team join (team) - joins the team"
  207.                         send "/team list - List of teams"
  208.                         send "/team info (team) - shows the invitation of the team"
  209.                         send "/team open - Anyone can join your team without invite"
  210.                         send "/team close - Closes the team"
  211.                 else if arg-1 is "clear":
  212.                         if player has permission "team.clear":
  213.                                 if {team list::*} contains arg-2:
  214.                                         delete {team owner.%arg-2%}
  215.                                         loop {team members players.%arg-2%::*}:
  216.                                                 send "Your team was disbanded by %player%" to loop-value
  217.                                                 delete {team.%loop-value%}
  218.                                         delete {team members players.%arg-2%::*}
  219.                                         delete {team members.%arg-2%}
  220.                                         remove arg-2 from {team list::*}
  221.                                         send "You cleared team %arg-2%"
  222.                                 else:
  223.                                         send "&cThis is not a real team"
  224.                         else:
  225.                                 make player execute command "/team help"
  226.                 else:
  227.                         make player execute command "/team help"
  228.  
  229. every 2 seconds:
  230.         loop all players:
  231.                 if {wanna delete.%{team.%loop-player%}%} is set:
  232.                         remove 2 from {wanna delete cooldown.%{team.%loop-player%}%}
  233.                         if {wanna delete cooldown.%{team.%loop-player%}%} is 0:
  234.                                 send "&cTime is over" to loop-player
  235.                                 delete {wanna delete cooldown.%{team.%loop-player%}%}
  236.                                 delete {wanna delete.%{team.%loop-player%}%}
  237.        
  238. on quit:
  239.         delete {invited to.%player%}
  240.                
  241. on chat:
  242.         if {team chat.%player%} is set:
  243.                 cancel event
  244.                 loop {team members players.%{team.%player%}%::*}:
  245.                         send "&6&l[TEAM CHAT] &e%player%: &e%message%" to loop-value
  246.         else:
  247.                 stop
  248.                
  249. on damage:
  250.         attacker is a player
  251.         victim is a player:
  252.                 if {team.%attacker%} is equal to {team.%victim%}:
  253.                         if {team trusted.%victim%} is true:
  254.                                 cancel event
  255.                                 send "&c%victim% &cis trusted in your guild" to attacker
  256.