Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- pre1: <light grey>[<gold>UHC<light grey>]<light green>
- pre2: <light grey>[<dark aqua>Captains<light grey>]<light aqua>
- command /captains [<text>] [<text>]:
- permission: skript.op
- aliases: /captain, /cap
- trigger:
- if arg 1 is "enable":
- set {captainsEnabled} to true
- message "{@pre1} <gold>Captains <light green>has been <green>enabled"
- stop
- else if arg 1 is "disable":
- set {captainsEnabled} to false
- message "{@pre1} <gold>Captains <light green>has been <red>disabled"
- stop
- else if {captainsEnabled} is false:
- message "{@pre1} <gold>Captains <light green>is <red>disabled"
- stop
- else:
- if arg 1 is "add" or "set":
- if arg 2 is set:
- set {captains::%arg 2%} to arg 2
- broadcast "{@pre2} <gold>%arg 2% <light aqua>is now a captain"
- stop
- else:
- set {captains::%player%} to player
- message "{@pre2} <gold>You <light aqua>are now a captain" to the player
- stop
- else if arg 1 is "remove":
- if arg 2 is set:
- remove arg 2 from {captains::*}
- broadcast "{@pre2} <gold>%arg 2% <light red>is no longer a captain"
- stop
- else:
- set {captains::%player%} to player
- message "{@pre2} <gold>You <light red>are no longer a captain"
- stop
- else if arg 1 is "reset":
- delete {captains::*}
- message "{@pre2} All captains have been reset" to the player
- stop
- else if arg 1 is "list":
- message "{@pre2} Current captains are<white>:" to the player
- loop {captains::*}:
- message "{@pre2} <gold>%{captains::%loop-value%}%" to the player
- else if arg 1 is "help":
- make player execute command "/captainshelp"
- stop
- else:
- message "Usage: /captains [<add,remove,reset,list,help>] [<playername>]" to the player
- command /captainsHelp:
- permission: skript.op
- aliases: /caphelp, /chelp
- trigger:
- if {captainsEnabled} is false:
- message "{@pre1} <gold>Captains <light green>is <red>disabled"
- stop
- else:
- message "{@pre2} --- <gold>Captains <light aqua>---" to the player
- message "{@pre2} The command for this skript are:" to the player
- message "{@pre2} <gold>/Captains" to the player
- message "{@pre2} <gold>/captainsRandom" to the player
- message "{@pre2} <gold>/captainsTeams" to the player
- message "{@pre2} <gold>/captainsSetColor" to the player
- message "{@pre2} <gold>/captainsPlayers" to the player
- message "{@pre2} <gold>/captainsPick" to the player
- message "{@pre2} <gold>/choose" to the player
- message "{@pre2} <gold>/captainsHelp" to the player
- message "{@pre2} and" to the player
- message "{@pre2} <gold>/captainsReset" to the player
- message "{@pre2} Use any of the commands with no arguments to see the usage" to the player
- command /captainsRandom [<int>]:
- permission: skript.op
- aliases: /capRandom, /cRandom, /crand
- trigger:
- if {captainsEnabled} is false:
- message "{@pre1} <gold>Captains <light green>is <red>disabled"
- stop
- else:
- if arg 1 is not set:
- message "{@pre2} You need to set how many random captains to make"
- message "{@pre2} <white>Usage: /captainsRandom <number of captains>"
- stop
- else:
- loop all players:
- if {captains::*} contains loop-player:
- message "{@pre2} %loop-player% is already already a captain"
- else:
- set {tempPlayerList::%loop-player%} to loop-player
- loop arg 1 times:
- set {_tempCurrentPlayer} to a random element out of {tempPlayerList::*}
- execute console command "cap add %{_tempCurrentPlayer}%"
- delete {_tempCurrentPlayer::*}
- delete {tempPlayerList::*}
- execute console command "captainsPlayers add all"
- execute console command "captainsTeams confirm"
- execute console command "captainsSetColor"
- command /captainsTeams [<text>]:
- permission: skript.op
- aliases: /capteams, /cteams
- trigger:
- if {captainsEnabled} is false:
- message "{@pre1} <gold>Captains <light green>is <red>disabled"
- stop
- else if arg 1 is not set:
- message "{@pre2} Use <gold>/captainsTeams confirm <light aqua>to setup the captains and teams" to the player
- message "{@pre2} This will reset all team related information" to the player
- else if arg 1 is "confirm":
- execute console command "team reset"
- set {captainsAmount} to size of {captains::*}
- loop {captainsAmount} times:
- execute console command "team create %loop-num%"
- loop {captains::*}:
- add loop-value to {_tempCaptainList::*}
- loop {captainsAmount} times:
- set {_currentCaptain} to a random element of {_tempCaptainList::*}
- remove {_currentCaptain} from {_tempCaptainList::*}
- execute console command "team join %loop-num% %{_currentCaptain}%"
- execute console command "warp cap%loop-num% %{_currentCaptain}%"
- set {captainTeam::%{_currentCaptain}%} to loop-num
- delete {_currentCaptain}
- else:
- message "{@pre2} Error in command" to the player
- message "Usage: /captainsTeams confirm" to the player
- command /captainsSetColor:
- permission: skript.op
- aliases: /capsetcolor, /capsetcolour, /capcolour, /capcolor, /ccolor ,/ccolour
- trigger:
- if {captainsEnabled} is false:
- message "{@pre1} <gold>Captains <light green>is <red>disabled"
- stop
- else if command sender does not have the permission "teams.setcolor":
- message "{@pre2} &cPermission denied &f(missing ""teams.setcolor"")"
- else if {Teams::*} is not set:
- message "{@pre2} No teams to color"
- else if (size of {Teams::*}) is bigger than 12:
- message "{@pre2} Too many teams to color"
- else:
- set {_Colors::*} to "blue", "red", "gold", "dark_purple", "dark_green", "aqua", "yellow", "dark_aqua", "dark_gray", "green", "gray" and "light_purple"
- loop {Teams::*}:
- set {_Color} to (first 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 "{@pre2} Your Team color is <%{_Color}%>%{_Color}%" to ("%loop-value-2%" parsed as offlineplayer)
- message "{@pre2} Colored all teams"
- loop all players:
- loop-player has the permission "teams.color.notify"
- loop-player is not command sender
- message "{@pre2} Colored all teams" to loop-player
- command /captainsPlayers [<text>] [<text>]:
- permission: skript.op
- aliases: /capPlayers, /captainPlayers ,/cplayers
- trigger:
- if {captainsEnabled} is false:
- message "{@pre1} <gold>Captains <light green>is <red>disabled"
- stop
- else if arg 1 is not set:
- message "{@pre2} <white>Usage: /captainsPlayers <add,remove,reset,list> <player,all>" to the player
- stop
- else if arg 1 is "add":
- if arg 2 is "all" or "everyone" or "*":
- loop all players:
- if {captains::*} contains loop-player:
- message "{@pre2} Captain <gold>%loop-player% <light aqua>has been skipped" to the player
- else if {playersOnTeams::*} contains loop-player:
- message "{@pre2} Captain <gold>%loop-player% <light aqua>has been skipped" to the player
- else:
- set {players::%loop-player%} to loop-player
- message "{@pre2} <gold>%loop-player% <light aqua>has been added" to the player
- else if arg 1 is "remove":
- arg 2 is set
- remove arg 2 from {players::*}
- remove arg 2 from {playersOnTeams::*}
- message "{@pre2} <gold>%arg 2% <light aqua>removed"
- stop
- else if arg 1 is "reset":
- if arg 2 is not "confirm":
- message "{@pre2} <light red>This will set all players who are not captains" to the player
- message "{@pre2} <white>Usage: /captainsPlayers reset confirm" to the player
- else:
- delete {players::*}
- delete {playersOnTeams::*}
- message "{@pre2} All players have been reset" to the player
- stop
- else if arg 1 is "list":
- message "{@pre2} Players not on a team are:<white>:" to the player
- loop {players::*}:
- message "{@pre2} <gold>%{players::%loop-value%}%" to the player
- message "{@pre2} <light red>On teams<white>:" to the player
- loop {playersOnTeams::*}:
- message "{@pre2} <gold>%{playersOnTeams::%loop-value%}%" to the player
- else:
- message "{@pre2} Error in command" to the player
- message "Usage: /captainsPlayers [<add,remove,reset,list>] [<playername,all>]" to the player
- command /captainsPick [<player>]:
- permission: skript.op
- aliases: /capPick, /cPick
- trigger:
- if {captainsEnabled} is false:
- message "{@pre1} <gold>Captains <light green>is <red>disabled"
- stop
- else if arg 1 is not set:
- message "{@pre2} Use <gold>/captainsPick <player name> <light aqua>to set the next picking captain" to the player
- stop
- else:
- delete {choosingCaptain::*}
- set {choosingCaptain::*} to arg 1
- broadcast "<gold>%arg 1% <light aqua>is now choosing a player"
- stop
- command /captainsStartAll [<text>]:
- permission: skript.op
- aliases: /capstartall, /cstartall
- trigger:
- if {captainsEnabled} is false:
- message "{@pre1} <gold>Captains <light green>is <red>disabled"
- stop
- else if arg 1 is not set:
- message "{@pre2} This command will keep running until every player is on teams" to the player
- message "{@pre2} Make sure all captains and players are set and that teams are set and coloured" to the player
- message "{@pre2} Use <gold>/captainsStartAll confirm <light aqua>if you are sure" to the player
- stop
- else:
- message "todo" to the player
- stop
- command /choose [<player>]:
- aliases: /pick
- trigger:
- if {captainsEnabled} is false:
- message "{@pre1} <gold>Captains <light green>is <red>disabled"
- stop
- else if {captains::*} does not contain player:
- message "{@pre2} <light red>You are not a captain, you can not use this command" to the player
- stop
- else if arg 1 is not set:
- message "{@pre2} <light red>Select a player to join your team" to the player
- message "{@pre2} <white>Usage: /choose <player name>" to the player
- stop
- else if {players::*} is not set:
- message "{@pre2} <light red>No players left not on teams" to the player
- if player is op:
- message "{@pre2} <light red>If you have not set players yet use <gold>/captainsPlayers add all" to the player
- message "{@pre2} <light aqua>Use the command <gold>/captainsPlayers <light aqua> with no arguments to see the usage" to the player
- stop
- else:
- if {choosingCaptain::*} is not player:
- message "{@pre2} <light red>You are not the captain that is current choosing" to the player
- stop
- else if {choosingCaptain::*} is not set:
- message "{@pre2} <light red>You are not the captain that is current choosing" to the player
- stop
- else:
- if {playersOnTeams::%arg 1%} is arg 1:
- message "{@pre2} <light red>That player is already on a team" to the player
- stop
- else:
- set {playersOnTeams::%arg 1%} to arg 1
- remove arg 1 from {players::*}
- broadcast "{@pre2} <gold>%player% <light aqua>has chosen <gold>%arg 1%"
- execute console command "team join %{captainTeam::%player%}% %arg 1%"
- execute console command "warp capteam%{captainTeam::%player%}% %arg 1%"
- delete {choosingCaptain::*}
- command /captainsReset [<text>]:
- permission: skript.op
- aliases: /capReset, /capRe, /cRe
- trigger:
- if arg 1 is not set:
- message "{@pre2} Use <gold>/captainsReset confirm <light aqua>to reset all Captains variables" to the player
- message "{@pre2} This will reset all team related information as well" to the player
- stop
- else if arg 1 is "confirm":
- delete {captains::*}
- delete {currentCaptain::*}
- delete {noTeamPlayers::*}
- delete {choosingCaptain::*}
- delete {playersOnTeams::*}
- delete {players::*}
- delete {captainTeam::*}
- delete {tempPlayerList::*}
- delete {captainsEnabled}
- delete {captainsAmount}
- execute console command "team reset"
- wait 5 ticks
- message "{@pre2} All captains information has been reset" to the player
- else:
- message "{@pre2} Error in command" to the player
- on skript start:
- set {captainsEnabled} to false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement