Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #variables
- #{Teams::%id%} - list of integer - all team numbers currently active
- #loop-index = loop-value - so {Teams::%id%} to check if team exists
- #{Team.%integer%::*} - list of "text" - player names in that team (TEXT!)
- #{Teams.InTeam::%player%} - integer/null - what team is player in?
- options:
- P: &f[&aTeams&f]&7
- N: &c&o%command sender%:&b
- S: &7
- IS: Invalid Syntax. &c/tm help&b?
- on: &a&lenabled
- off: &c&Ldisabled
- C: &7
- H: &d&L
- command /teams [<text>]:
- permission: skript.op
- trigger:
- if arg-1 is "on" or "enable":
- set {teams} to true
- broadcast "{@P} Team management has been enabled."
- broadcast ""
- broadcast " {@S}- {@H}/team create &8&L|{@C} Create a team!"
- broadcast " {@S}- {@H}/team invite &8&L|{@C} Invite a player to your team!"
- broadcast " {@S}- {@H}/team &8&L|{@C} List all commands!"
- broadcast ""
- command "/aps note.bass"
- else if arg-1 is "off" or "disable":
- delete {teams}
- broadcast "{@P} Team management has been disabled."
- command "/aps note.bass"
- command /team [<text>] [<player>]:
- trigger:
- if arg-1 is not set:
- if {teams} is not set:
- message "{@P} Teams are currently disabled."
- else if {teams} is true:
- message "{@P} Teams are currently enabled."
- message "{@P} List of all commands:"
- message "{@S} /team create"
- message "{@S} /team invite"
- message "{@S} /team accept"
- message "{@S} /team deny"
- message "{@S} /team leave"
- message "{@S} /team list"
- command "/playsound note.harp %command sender% ~ ~ ~ 1 1 1"
- else if arg-1 is "create":
- if {teams} is true:
- if {inteam::%command sender%} is set:
- message "{@P} You are already on a team!"
- message "{@S} /team leave"
- else if {inteam::%command sender%} is not set:
- add 1 to {totalteams}
- command "/tm create %{totalteams}%"
- message "{@P} You have created your team!"
- command "/tm join %{totalteams}% %command sender%"
- set {inteam::%command sender%} to true
- set {captain::%command sender%} to true
- set {tn::%command sender%} to {totalteams}
- else if {teams} is not set:
- message "{@P} Teams are disabled!"
- command "/playsound random.break %command sender% ~ ~ ~ 1 1 1"
- else if arg-1 is "leave":
- if {teams} is true:
- if {inteam::%command sender%} is set:
- command "/tm leave %command sender%"
- delete {captain::%command sender%}
- message "{@P} You have left your team."
- delete {inteam::%command sender%}
- delete {tn::%command sender%}
- else if {inteam::%command sender%} is not set:
- message "{@P} You are not on a team!"
- else if {teams} is not set:
- message "{@P} Teams are disabled!"
- else if arg-1 is "reset":
- if command sender is op:
- command "/tm reset"
- broadcast "{@P} All teams have been reset."
- delete {totalteams}
- delete {inteam::*}
- delete {pendingteam::*}
- delete {pending::*}
- delete {teamleader::*}
- delete {captain::*}
- delete {tn::*}
- delete {teamnumber::*}
- else if command sender is not op:
- message "&7&LYou don't have the correct permissions!"
- else if arg-1 is "invite":
- if {teams} is true:
- if {captain::%command sender%} is true:
- if {inteam::%arg-2%} is set:
- message "{@P}{@H} %arg-2%{@C} is already on a team!"
- else if {pending::%arg-2%} is set:
- message "{@P}{@H} %arg-2%{@C} already has a pending invite!"
- else if {pending::%arg-2%} is not set:
- set {pending::%arg-2%} to true
- set {teamnumber::%arg-2%} to {tn::%command sender%}
- set {_TeamNumber} to {Teams.InTeam::%command sender%}
- loop {Team.%{_TeamNumber}%::*}:
- set {_TeamPlayer} to ("%loop-value-1%" parsed as offlineplayer)
- if {_TeamPlayer} is online:
- message "{@P} %arg-2% was invited to your team." to {_TeamPlayer}
- message "{@P} %command sender% has invited you to their team!" to arg-2
- message " {@S}- &b/team accept &7or &b/team deny" to arg-2
- else if {captain::%command sender%} is not set:
- message "{@P} You are not the team captain!"
- else if {teams} is not set:
- message "{@P} Teams are disabled!"
- else if arg-1 is "accept":
- if {teams} is true:
- if {pending::%command sender%} is set:
- delete {pending::%command sender%}
- set {inteam::%command sender%} to true
- command "/tm join %{teamnumber::%command sender%}% %command sender%"
- message "{@P} You have joined the team!"
- else if {pending::%command sender%} is not set:
- message "{@P} You have no pending invites!"
- else if {teams} is not set:
- message "{@P} Teams are disabled!"
- else if arg-1 is "deny":
- if {teams} is true:
- if {pending::%command sender%} is set:
- delete {pending::%command sender%}
- delete {tn::%command sender%}
- set {_TeamNumber} to {teamnumber::%command sender%}
- delete {teamnumber::%command sender%}
- loop {Team.%{_TeamNumber}%::*}:
- set {_TeamPlayer} to ("%loop-value-1%" parsed as offlineplayer)
- if {_TeamPlayer} is online:
- message "{@P} &7%command sender% has denied the invite." to {_TeamPlayer}
- message "{@P} You have denied the team request!"
- else if {pending::%command sender%} is not set:
- message "{@P} You have no pending invites!"
- else if {teams} are not set:
- message "{@P} Teams are disabled!"
- else if arg-1 is "list":
- if {teams} is true:
- if {inteam::%command sender%} is set:
- message "{@P} Listing your current team members:"
- set {_Player} to command sender
- set {_TeamNumber} to {Teams.InTeam::%command sender%}
- loop {Team.%{_TeamNumber}%::*}:
- message " &7- &b%loop-value%" to command sender
- else:
- message "{@P} You are not in a team!"
- else if {teams} are not set:
- message "{@P} Teams are disabled!"
- #----------------------------------------------------------------------------------------------------------------------------------
- command /tm [<text>] [<text>] [<text>] [<text>] [<text>]:
- trigger:
- if arg 1 is not set:
- command sender command "/tm help"
- else if arg 1 is equal to "help":
- if command sender does not have the permission "teams.help":
- message "{@P} &4You don't have the correct permissions!"
- else:
- message "{@P} Listing all commands."
- message "{@S}- /tm list &a- &6Lists all current teams"
- message "{@S}- /tm create &a- &6Create a team"
- message "{@S}- /tm delete &a- &6Delete Team"
- message "{@S}- /tm join &a- &6Put <player> in Team"
- message "{@S}- /tm leave &a- &6Remove <player> from Team"
- message "{@S}- /tm color &a- &6Color all teams at once"
- message "{@S}- /tm uncolor &a- &6Remove all colors from teams"
- message "{@S}- /tm rebuild &a- &6Rebuild teams, skip empty"
- message "{@S}- /tm random <size> <amount> [extend] &a- &6Create Random Teams"
- message "{@S}- /tm reset &a- &6Reset all teams"
- else if arg 1 is equal to "list":
- if {Teams::*} is not set:
- message "{@P} No teams defined."
- else:
- loop {Teams::*}:
- message "&bTeam %loop-value%&a:"
- loop {Team.%loop-value%::*}:
- message "&b&l- &c&o%loop-value-2%"
- else if arg 1 is equal to "create":
- if command sender does not have the permission "teams.create":
- message "{@P} &4You don't have the correct permissions!"
- else if arg 2 is not set:
- message "{@P} {@IS}"
- else if arg 3 is set:
- message "{@P} {@IS}"
- else:
- set {_TeamNumber} to ("%arg 2%" parsed as integer)
- if {_TeamNumber} is not set:
- message "{@P} {@IS}"
- else if {_TeamNumber} is smaller than 1:
- message "{@P} Invalid Team Number!"
- else if {Teams::%{_TeamNumber}%} is set:
- message "{@P} That team already exists."
- else:
- set {Teams::%{_TeamNumber}%} to {_TeamNumber}
- command "/scoreboard teams add UHC%{_TeamNumber}%"
- message "{@P} &7Team %{_TeamNumber}% successfully created."
- else if arg 1 is equal to "delete":
- if command sender does not have the permission "teams.delete":
- message "{@P} &4You don't have the correct permissions!"
- else if arg 2 is not set:
- message "{@P} {@IS}"
- else if arg 3 is set:
- message "{@P} {@IS}"
- else:
- set {_TeamNumber} to ("%arg 2%" parsed as integer)
- if {_TeamNumber} is not set:
- message "{@P} {@IS}"
- else if {_TeamNumber} is smaller than 1:
- message "{@P} Invalid Team Number!"
- else if {Teams::%{_TeamNumber}%} is not set:
- message "{@P} Team not found!"
- else:
- delete {Teams::%{_TeamNumber}%}
- loop {Team.%{_TeamNumber}%::*}:
- message "{@P} Your team was deleted." to ("%loop-value%" parsed as offlineplayer)
- delete {Teams.InTeam::%loop-value%}
- delete {Team.%{_TeamNumber}%::*}
- command "/scoreboard teams remove UHC%{_TeamNumber}%"
- message "{@P} Deleted Team &a%{_TeamNumber}%"
- else if arg 1 is equal to "join":
- if command sender does not have the permission "teams.join":
- message "{@P} &4You don't have the correct permissions!"
- else if arg 2 is not set:
- message "{@P} {@IS}"
- else if arg 4 is set:
- message "{@P} {@IS}"
- else:
- set {_TeamNumber} to ("%arg 2%" parsed as integer)
- if {_TeamNumber} is not set:
- message "{@P} {@IS}"
- else if {_TeamNumber} is smaller than 1:
- message "{@P} Invalid Team Number!"
- else if {Teams::%{_TeamNumber}%} is not set:
- message "{@P} Team does not exist!"
- else:
- if arg 3 is not set:
- if command sender is console:
- message "{@P} {@IS}"
- stop
- set {_Player} to (name of command sender)
- else:
- set {_Player} to arg 3
- if {Teams.InTeam::%{_Player}%} is set:
- message "{@P} Player %{_Player}% is already in a team!"
- else:
- loop {Team.%{_TeamNumber}%::*}:
- set {_TeamPlayer} to ("%loop-value-1%" parsed as offlineplayer)
- if {_TeamPlayer} is online:
- message "{@P} &d&L%{_Player}% &7has joined your team." to {_TeamPlayer}
- set {Teams.InTeam::%{_Player}%} to {_TeamNumber}
- add {_Player} to {Team.%{_TeamNumber}%::*}
- command "/scoreboard teams join UHC%{_TeamNumber}% %{_Player}%"
- else if arg 1 is equal to "leave":
- if command sender does not have the permission "teams.leave":
- message "{@P} &4You don't have the correct permissions!"
- else if arg 3 is set:
- message "{@P} {@IS}"
- else:
- if arg 2 is not set:
- if command sender is console:
- message "{@P} {@IS}"
- stop
- set {_Player} to (name of command sender)
- else:
- set {_Player} to arg 2
- if {Teams.InTeam::%{_Player}%} is not set:
- message "{@P} Player %{_Player}% is not in a team!"
- else:
- set {_TeamNumber} to {Teams.InTeam::%{_Player}%}
- delete {Teams.InTeam::%{_Player}%}
- remove {_Player} from {Team.%{_TeamNumber}%::*}
- command "/scoreboard teams leave %{_Player}%"
- loop {Team.%{_TeamNumber}%::*}:
- set {_TeamPlayer} to ("%loop-value-1%" parsed as offlineplayer)
- if {_TeamPlayer} is online:
- message "{@P} &d&L%{_Player}% &7was kicked from your team." to {_TeamPlayer}
- else if arg 1 is equal to "color":
- if command sender does not have the permission "teams.color":
- message "{@P} &4You don't have the correct permissions!"
- else if arg 2 is set:
- message "{@P} {@IS}"
- else if {Teams::*} is not set:
- message "{@P} No teams to color!"
- else if (size of {Teams::*}) is bigger than 90:
- message "{@P} Too many teams to color!"
- else:
- if (size of {Teams::*}) is smaller than 16:
- set {_Colors::*} to "aqua", "black", "blue", "dark_aqua", "dark_blue", "dark_gray", "dark_green", "dark_purple", "dark_red", "gold", "gray", "green", "light_purple", "red" and "yellow"
- else if (size of {Teams::*}) is smaller than 20:
- set {_Colors::*} to "aqua", "black", "blue", "bold", "dark_aqua", "dark_blue", "dark_gray", "dark_green", "dark_purple", "dark_red", "gold", "gray", "green", "italic", "light_purple", "red", "strikethrough", "underline" and "yellow"
- else if (size of {Teams::*}) is equal to 20:
- set {_Colors::*} to "aqua", "black", "blue", "bold", "dark_aqua", "dark_blue", "dark_gray", "dark_green", "dark_purple", "dark_red", "gold", "gray", "green", "italic", "light_purple", "red", "strikethrough", "underline", "white" and "yellow"
- else:
- set {_Colors::*} to "aqua", "black", "blue", "bold", "dark_aqua", "dark_blue", "dark_gray", "dark_green", "dark_purple", "dark_red", "gold", "gray", "green", "italic", "light_purple", "red", "strikethrough", "underline", "white", and "yellow"
- set {_Other.Colors::*} to "aqua", "black", "blue", "dark_aqua", "dark_blue", "dark_gray", "dark_green", "dark_purple", "dark_red", "gold", "gray", "green", "light_purple", "red", and "yellow"
- set {_Format.Codes::*} to "bold", "italic", "strikethrough", and "underline"
- loop {Teams::*}:
- if loop-value is less than or equal to 21:
- set {_Color} to (random element out of {_Colors::*})
- remove {_Color} from {_Colors::*}
- command "/scoreboard teams option UHC%loop-value% color %{_Color}%"
- replace all "_" with " " in {_Color}
- loop {Team.%loop-value%::*}:
- message "{@P} Your team color is <%{_Color}%>%{_Color}%!" to ("%loop-value-2%" parsed as offlineplayer)
- else:
- delete {_Colors::*}
- set {_Color} to (random element out of {_Other.Colors::*})
- set {_Format} to (random element out of {_Format.Codes::*})
- remove {_Color} from {_Other.Colors::*}
- command "/scoreboard teams option UHC%loop-value% color %{_Color}%"
- replace all "_" with " " in {_Color}
- loop {Team.%loop-value%::*}:
- message "{@P} Your team color is <%{_Color}%><%{_Format}%>%{_Format}% %{_Color}%!" to ("%loop-value-2%" parsed as offlineplayer)
- execute console command "/%{_Format}% UHC%loop-value%"
- message "{@P} All teams have been colored!"
- else if arg 1 is equal to "uncolor":
- if command sender does not have the permission "teams.uncolor":
- message "{@P} &4You don't have the correct permissions!"
- else if arg 2 is set:
- message "{@P} {@IS}"
- else if {Teams::*} is not set:
- message "{@P} No teams found!"
- else:
- loop {Teams::*}:
- command "/scoreboard teams option UHC%loop-value% color reset"
- loop {Team.%loop-value%::*}:
- message "{@P} Your color was removed." to ("%loop-value-2%" parsed as offlineplayer)
- message "{@P} Uncolored all teams"
- loop all players:
- loop-player has the permission "teams.uncolor.notify"
- loop-player is not command sender
- message "{@P} {@N} Uncolored all teams" to loop-player
- else if arg 1 is equal to "rebuild":
- if command sender does not have the permission "teams.rebuild":
- message "{@P} &4You don't have the correct permissions!"
- else if arg 2 is set:
- message "{@P} {@IS}"
- else:
- set {_TeamCount} to 0
- delete {Teams.InTeam::*}
- loop {Teams::*}:
- if (size of {Team.%loop-value%::*}) is not equal to 0:
- message "%loop-value%"
- set {_TeamCount} to {_TeamCount}+1
- set {_New.Team.%{_TeamCount}%::*} to {Team.%loop-value%::*}
- set {_New.Teams::%{_TeamCount}%} to {_TeamCount}
- delete {Team.%loop-value%::*}
- command "/scoreboard teams remove UHC%loop-value%"
- delete {Teams::*}
- set {Teams::*} to {_New.Teams::*}
- loop {Teams::*}:
- command "/scoreboard teams add UHC%loop-value%"
- set {Team.%loop-value%::*} to {_New.Team.%loop-value%::*}
- loop {Team.%loop-value%::*}:
- set {Teams.InTeam::%loop-value-2%} to loop-value-1
- command "/scoreboard teams join UHC%loop-value-1% %loop-value-2%"
- message "{@P} Teams rebuilt."
- loop all players:
- loop-player has the permission "teams.rebuild.notify"
- loop-player is not command sender
- message "{@P} {@N} Rebuilt teams." to loop-player
- else if arg 1 is equal to "random":
- if command sender does not have the permission "teams.random":
- message "{@P} &4You don't have the correct permissions!"
- else if arg 2 is not set:
- message "{@P} {@IS}"
- else if arg 3 is not set:
- message "{@P} {@IS}"
- else:
- set {_TeamSize} to ("%arg 2%" parsed as integer)
- set {_TeamAmount} to ("%arg 3%" parsed as integer)
- if {_TeamSize} is not set:
- message "{@P} {@IS}"
- else if {_TeamAmount} is not set:
- message "{@P} {@IS}"
- else if {_TeamSize} is less than 1:
- message "{@P} {@IS}"
- else if {_TeamAmount} is less than 1:
- message "{@P} {@IS}"
- else:
- loop all players:
- {Teams.InTeam::%loop-player%} is not set
- add (name of loop-player) to {_Players::*}
- if ({_TeamSize}*{_TeamAmount}) is not equal to (size of {_Players::*}):
- message "{@P} The amount of people does not match."
- else:
- loop {Teams::*}:
- command "/scoreboard teams remove UHC%loop-value%"
- delete {Team.%loop-value%::*}
- delete {Teams.InTeam::*}
- delete {Teams::*}
- broadcast "{@P} Randomizing teams!"
- broadcast " {@S}&7- &b%arg-3% &teams of %arg-2%!"
- loop all players:
- command "/playsound note.harp %loop-player%"
- wait 10 ticks
- loop {_TeamAmount} times:
- command "/scoreboard teams add UHC%loop-number%"
- set {Teams::%loop-number%} to loop-number
- loop {_TeamSize} times:
- set {_Player} to (random element out of {_Players::*})
- remove {_Player} from {_Players::*}
- command "/scoreboard teams join UHC%loop-number-1% %{_Player}%"
- add {_Player} to {Team.%loop-number-1%::*}
- set {Teams.InTeam::%{_Player}%} to loop-number-1
- loop {Teams::*}:
- loop {Team.%loop-value%::*}:
- set {_Player} to ("%loop-value-2%" parsed as offlineplayer)
- if {_Player} is online:
- message "{@P} &aYour team is:" to {_Player}
- loop {Team.%loop-value-1%::*}:
- loop-value-3 is not equal to loop-value-2
- message "&c%loop-value-3%" to {_Player}
- if arg 4 is set:
- if arg 4 is equal to "extend":
- set {_Extend} to true
- if {_Extend} is not set:
- broadcast "{@P} &bTeams are randomized!"
- else:
- broadcast "{@P} &bTeams are randomized!"
- loop all players:
- command "/playsound random.explode %loop-player%"
- else if arg 1 is equal to "reset":
- if command sender does not have the permission "teams.reset":
- message "{@P} &4You don't have the correct permissions!"
- else if arg 2 is set:
- message "{@P} {@IS}"
- else:
- loop {Teams::*}:
- command "/scoreboard teams remove UHC%loop-value%"
- delete {Team.%loop-value%::*}
- delete {Teams::*}
- delete {Teams.InTeam::*}
- else:
- command sender command "/tm help"
- #----------------------------------------------------------------------------------------------------------------------------------
- command /pm <text>:
- executable by: players
- trigger:
- if {Teams.InTeam::%command sender%} is not set:
- message "{@P} Team not found."
- else:
- set {_Team} to {Teams.InTeam::%command sender%}
- loop all players:
- if {Teams.InTeam::%loop-player%} is equal to {_Team}:
- message "&7[&aTeamChat&7] &b%command sender%&a: &7%arg 1%" to loop-player
- else if {PMSocialSpy::%loop-player%} is true:
- message "&7[&aPMS&7] &7[&b%{_Team}%&7] &7&o%command sender%&b: &r%arg 1%" to loop-player
- command /pms:
- permission: skript.pm.socialspy
- trigger:
- if {PMSocialSpy::%command sender%} is not set:
- set {PMSocialSpy::%command sender%} to true
- message "&6Team Social Spy is now &a&Lenabled&6."
- else:
- delete {PMSocialSpy::%command sender%}
- message "&6Team Social Spy is now &c&ldisabled&6."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement