Advertisement
Guest User

VfV

a guest
Sep 26th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.25 KB | None | 0 0
  1. options:
  2. P: <gray>[<purple>Mystery Teams<gray>]<white>
  3. N: §4§o%command sender%:§r
  4.  
  5. IS: Invalid Syntax. §b/team help§r?
  6.  
  7. variables:
  8. {Team1} = 0
  9. {Team2} = 0
  10. command /team [<text>] [<text>] [<text>] [<text>] [<text>]:
  11. trigger:
  12. if arg 1 is not set:
  13. command sender command "/team help"
  14. else if arg 1 is equal to "help":
  15. if command sender does not have the permission "teams.help":
  16. message "{@P} §4Permission denied. §r(missing ""teams.help"")"
  17. else:
  18. message "§6/team help §4- §7This help page"
  19. message "§6/team list §4- §7List teams"
  20. message "§6/team create [<id>] §4- §7Create Team"
  21. message "§6/team delete <id> §4- §7Delete Team"
  22. message "§6/team join <id> [<player=you>] §4- §7Put <player> in Team"
  23. message "§6/team remove [<player=you>] §4- §7Remove <player> from Team"
  24. message "§6/team color §4- §7Color all teams at once"
  25. message "§6/team rebuild §4- §7Rebuild teams, skip empty"
  26. message "§6/team random <size> <amount> [extend] §4- §7Create Random Teams"
  27. message "§6/team reset §4- §7Reset all teams"
  28. else if arg 1 is equal to "list":
  29. command sender has permission "skript.op"
  30. if {Teams::*} is not set:
  31. message "{@P} No teams defined."
  32. else:
  33. loop {Teams::*}:
  34. message "§6Team %loop-value%:"
  35. loop {Team.%loop-value%::*}:
  36. message "§7§l- §c§o%loop-value-2%"
  37. else if arg 1 is equal to "create":
  38. if command sender does not have the permission "teams.create":
  39. message "{@P} §4Permission denied. §r(missing ""teams.create"")"
  40. else if arg 2 is not set:
  41. message "{@P} {@IS}"
  42. else if arg 3 is set:
  43. message "{@P} {@IS}"
  44. else:
  45. set {_TeamNumber} to ("%arg 2%" parsed as integer)
  46. if {_TeamNumber} is not set:
  47. message "{@P} {@IS}"
  48. else if {_TeamNumber} is smaller than 1:
  49. message "{@P} Invalid Team Number!"
  50. else if {Teams::%{_TeamNumber}%} is set:
  51. message "{@P} That team already exists."
  52. else:
  53. set {Teams::%{_TeamNumber}%} to {_TeamNumber}
  54.  
  55. message "{@P} Created Team §6%{_TeamNumber}%"
  56. loop all players:
  57. loop-player has the permission "teams.create.notify"
  58. loop-player is not command sender
  59. message "{@P} {@N} Created Team§6%{_TeamNumber}%" to loop-player
  60. else if arg 1 is equal to "delete":
  61. if command sender does not have the permission "teams.delete":
  62. message "{@P} §4Permission denied. §r(missing ""teams.delete"")"
  63. else if arg 2 is not set:
  64. message "{@P} {@IS}"
  65. else if arg 3 is set:
  66. message "{@P} {@IS}"
  67. else:
  68. set {_TeamNumber} to ("%arg 2%" parsed as integer)
  69. if {_TeamNumber} is not set:
  70. message "{@P} {@IS}"
  71. else if {_TeamNumber} is smaller than 1:
  72. message "{@P} Invalid Team Number!"
  73. else if {Teams::%{_TeamNumber}%} is not set:
  74. message "{@P} That team does not exist."
  75. else:
  76. delete {Teams::%{_TeamNumber}%}
  77. loop {Team.%{_TeamNumber}%::*}:
  78. message "{@P} Your team was deleted." to ("%loop-value%" parsed as offlineplayer)
  79. delete {Teams.InTeam::%loop-value%}
  80. delete {Team.%{_TeamNumber}%::*}
  81.  
  82. message "{@P} Deleted Team §6%{_TeamNumber}%"
  83. loop all players:
  84. loop-player has the permission "teams.delete.notify"
  85. loop-player is not command sender
  86. message "{@P} {@N} Deleted Team §6%{_TeamNumber}%" to loop-player
  87. else if arg 1 is equal to "join":
  88. if command sender does not have the permission "teams.join":
  89. message "{@P} §4Permission denied. §r(missing ""teams.join"")"
  90. else if arg 2 is not set:
  91. message "{@P} {@IS}"
  92. else if arg 4 is set:
  93. message "{@P} {@IS}"
  94. else:
  95. set {_TeamNumber} to ("%arg 2%" parsed as integer)
  96. if {_TeamNumber} is not set:
  97. message "{@P} {@IS}"
  98. else if {_TeamNumber} is smaller than 1:
  99. message "{@P} Invalid Team Number!"
  100. else if {Teams::%{_TeamNumber}%} is not set:
  101. message "{@P} Team does not exist!"
  102. else:
  103. if arg 3 is not set:
  104. if command sender is console:
  105. message "{@P} {@IS}"
  106. stop
  107. set {_Player} to (name of command sender)
  108. else:
  109. set {_Player} to arg 3
  110.  
  111. if {Teams.InTeam::%{_Player}%} is set:
  112. message "{@P} Player %{_Player}% is already in a team!"
  113. else:
  114. loop {Team.%{_TeamNumber}%::*}:
  115. set {_TeamPlayer} to ("%loop-value-1%" parsed as offlineplayer)
  116. if {_TeamPlayer} is online:
  117. message "{@P} §6%{_Player}% §rhas been added to your team." to {_TeamPlayer}
  118.  
  119. set {Teams.InTeam::%{_Player}%} to {_TeamNumber}
  120. add {_Player} to {Team.%{_TeamNumber}%::*}
  121.  
  122. message "{@P} You were added to §6Team %{_TeamNumber}%" to ("%{_Player}%" parsed as offlineplayer)
  123. message "{@P} Added §c%{_Player}% §rto Team §6%{_TeamNumber}%"
  124. loop all players:
  125. loop-player has the permission "teams.join.notify"
  126. loop-player is not command sender
  127. message "{@P} {@N} Added §c%{_Player}% §rto Team §6%{_TeamNumber}%" to loop-player
  128. else if arg 1 is equal to "remove":
  129. if command sender does not have the permission "teams.leave":
  130. message "{@P} §4Permission denied. §r(missing ""teams.leave"")"
  131. else if arg 3 is set:
  132. message "{@P} {@IS}"
  133. else:
  134. if arg 2 is not set:
  135. if command sender is console:
  136. message "{@P} {@IS}"
  137. stop
  138. set {_Player} to (name of command sender)
  139. else:
  140. set {_Player} to arg 2
  141.  
  142. if {Teams.InTeam::%{_Player}%} is not set:
  143. message "{@P} Player %{_Player}% is not in a team!"
  144. else:
  145. set {_TeamNumber} to {Teams.InTeam::%{_Player}%}
  146. delete {Teams.InTeam::%{_Player}%}
  147. remove {_Player} from {Team.%{_TeamNumber}%::*}
  148.  
  149. loop {Team.%{_TeamNumber}%::*}:
  150. set {_TeamPlayer} to ("%loop-value-1%" parsed as offlineplayer)
  151. if {_TeamPlayer} is online:
  152. message "{@P} §6%{_Player}% §rhas been removed from your team." to {_TeamPlayer}
  153.  
  154. message "{@P} You were removed from §6Team %{_TeamNumber}%" to ("%{_Player}%" parsed as offlineplayer)
  155. message "{@P} Removed §c%{_Player}% §rfrom Team §6%{_TeamNumber}%"
  156. loop all players:
  157. loop-player has the permission "teams.join.notify"
  158. loop-player is not command sender
  159. message "{@P} {@N} Removed §c%{_Player}% §rfrom Team §6%{_TeamNumber}%" to loop-player
  160. else if arg 1 is equal to "color":
  161. if command sender does not have the permission "teams.color":
  162. message "{@P} §4Permission denied. §r(missing ""teams.uncolor"")"
  163. else if arg 2 is set:
  164. message "{@P} {@IS}"
  165. else if {Teams::*} is not set:
  166. message "{@P} No teams to color!"
  167. else if (size of {Teams::*}) is bigger than 40:
  168. message "{@P} Too many teams to color!"
  169. else:
  170. if (size of {Teams::*}) is smaller than 16:
  171. 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"
  172. else if (size of {Teams::*}) is smaller than 20:
  173. 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"
  174. else if (size of {Teams::*}) is equal to 20:
  175. 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"
  176. else:
  177. 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"
  178. 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"
  179. set {_Format.Codes::*} to "bold", "italic", "strikethrough", and "underline"
  180. loop {Teams::*}:
  181. if loop-value is less than or equal to 21:
  182. set {_Color} to (random element out of {_Colors::*})
  183. remove {_Color} from {_Colors::*}
  184. command "/scoreboard teams option UHC%loop-value% color %{_Color}%"
  185. replace all "_" with " " in {_Color}
  186. loop {Team.%loop-value%::*}:
  187. message "{@P} Your team's color is <%{_Color}%>%{_Color}%!" to ("%loop-value-2%" parsed as offlineplayer)
  188. else:
  189. delete {_Colors::*}
  190. set {_Color} to (random element out of {_Other.Colors::*})
  191. set {_Format} to (random element out of {_Format.Codes::*})
  192. remove {_Color} from {_Other.Colors::*}
  193. command "/scoreboard teams option UHC%loop-value% color %{_Color}%"
  194. replace all "_" with " " in {_Color}
  195. loop {Team.%loop-value%::*}:
  196. message "{@P} Your team's color and format is <%{_Color}%><%{_Format}%>%{_Format}% %{_Color}%!" to ("%loop-value-2%" parsed as offlineplayer)
  197. execute console command "/%{_Format}% UHC%loop-value%"
  198.  
  199. message "{@P} Colored all teams"
  200. loop all players:
  201. loop-player has the permission "teams.color.notify"
  202. loop-player is not command sender
  203. message "{@P} {@N} Colored all teams" to loop-player
  204. else if arg 1 is equal to "rebuild":
  205. if command sender does not have the permission "teams.rebuild":
  206. message "{@P} §4Permission denied. §r(missing ""teams.rebuild"")"
  207. else if arg 2 is set:
  208. message "{@P} {@IS}"
  209. else:
  210. set {_TeamCount} to 0
  211. delete {Teams.InTeam::*}
  212. loop {Teams::*}:
  213. if (size of {Team.%loop-value%::*}) is not equal to 0:
  214. message "%loop-value%"
  215. set {_TeamCount} to {_TeamCount}+1
  216. set {_New.Team.%{_TeamCount}%::*} to {Team.%loop-value%::*}
  217. set {_New.Teams::%{_TeamCount}%} to {_TeamCount}
  218. delete {Team.%loop-value%::*}
  219. delete {Teams::*}
  220. set {Teams::*} to {_New.Teams::*}
  221. loop {Teams::*}:
  222. set {Team.%loop-value%::*} to {_New.Team.%loop-value%::*}
  223. loop {Team.%loop-value%::*}:
  224. set {Teams.InTeam::%loop-value-2%} to loop-value-1
  225. message "{@P} Issued Rebuild"
  226. loop all players:
  227. loop-player has the permission "teams.rebuild.notify"
  228. loop-player is not command sender
  229. message "{@P} {@N} Issued Rebuild" to loop-player
  230. else if arg 1 is equal to "random":
  231. if command sender does not have the permission "teams.random":
  232. message "{@P} §4Permission denied. §r(missing ""teams.random"")"
  233. else if arg 2 is not set:
  234. message "{@P} {@IS}"
  235. else if arg 3 is not set:
  236. message "{@P} {@IS}"
  237. else:
  238. set {_TeamSize} to 2
  239. set {_TeamAmount} to ("%arg 2%" parsed as integer)
  240. if {_TeamSize} is not set:
  241. message "{@P} {@IS}"
  242. else if {_TeamAmount} is not set:
  243. message "{@P} {@IS}"
  244. else if {_TeamSize} is less than 1:
  245. message "{@P} {@IS}"
  246. else if {_TeamAmount} is less than 1:
  247. message "{@P} {@IS}"
  248. else:
  249. loop all players:
  250. {Teams.InTeam::%loop-player%} is not set
  251. add (name of loop-player) to {_Players::*}
  252.  
  253. if ({_TeamSize}*{_TeamAmount}) is not equal to (size of {_Players::*}):
  254. message "{@P} The amount of people does not match."
  255. else:
  256. loop {Teams::*}:
  257. command "/scoreboard teams remove UHC%loop-value%"
  258. delete {Team.%loop-value%::*}
  259. delete {Teams.InTeam::*}
  260. delete {Teams::*}
  261. broadcast "{@P} Randomizing §6%arg 3% teams §cof %arg 2%§r..."
  262. loop all players:
  263. command "/playsound note.harp %loop-player%"
  264. wait 10 ticks
  265. loop {_TeamAmount} times:
  266. command "/scoreboard teams add UHC%loop-number%"
  267. set {Teams::%loop-number%} to loop-number
  268. loop {_TeamSize} times:
  269. set {_Player} to (random element out of {_Players::*})
  270. remove {_Player} from {_Players::*}
  271. command "/scoreboard teams join UHC%loop-number-1% %{_Player}%"
  272. add {_Player} to {Team.%loop-number-1%::*}
  273. set {Teams.InTeam::%{_Player}%} to loop-number-1
  274. loop {Teams::*}:
  275. loop {Team.%loop-value%::*}:
  276. set {_Player} to ("%loop-value-2%" parsed as offlineplayer)
  277. if {_Player} is online:
  278. message "{@P} §6Your team!" to {_Player}
  279. loop {Team.%loop-value-1%::*}:
  280. loop-value-3 is not equal to loop-value-2
  281. message "{@P} §7§l- §c§o%loop-value-3%" to {_Player}
  282. if arg 4 is set:
  283. if arg 4 is equal to "extend":
  284. set {_Extend} to true
  285. if {_Extend} is not set:
  286. broadcast "{@P} §7Teams are randomized!"
  287. loop all players:
  288. command "/playsound random.explode %loop-player%"
  289. else if arg 1 is equal to "reset":
  290. if command sender does not have the permission "teams.reset":
  291. message "{@P} §4Permission denied. §r(missing ""teams.reset"")"
  292. else if arg 2 is set:
  293. message "{@P} {@IS}"
  294. else:
  295. loop {Teams::*}:
  296. loop {Team.%loop-value%::*}:
  297. message "{@P} Your team was deleted in a global reset." to ("%loop-value-2%" parsed as offlineplayer)
  298. delete {Team.%loop-value%::*}
  299. delete {Teams::*}
  300. delete {Teams.InTeam::*}
  301. message "{@P} All teams reset"
  302. loop all players:
  303. loop-player has the permission "teams.reset.notify"
  304. loop-player is not command sender
  305. message "{@P} {@N} Reset all teams" to loop-player
  306. else:
  307. command sender command "/team help"
  308.  
  309. command /ct <text> <text>:
  310. permission: teams.createteam
  311. usage: /ct <player> <player
  312. trigger:
  313. add (arg 1) to {_ThisTeam::*}
  314. add (arg 2) to {_ThisTeam::*}
  315. loop {_ThisTeam::*}:
  316. {Teams.InTeam::%loop-value%} is set
  317. add loop-value to {_AlreadyOnTeam::*}
  318.  
  319. if {_AlreadyOnTeam::*} is set:
  320. message "{@P} The following players are already on a team."
  321. message "{@P} %join {_AlreadyOnTeam::*} with "", ""%"
  322. else:
  323. set {_TeamNumber} to 1
  324. while {Teams::%{_TeamNumber}%} is set:
  325. set {_TeamNumber} to {_TeamNumber}+1
  326.  
  327. set {Teams::%{_TeamNumber}%} to {_TeamNumber}
  328. command "/scoreboard teams add UHC%{_TeamNumber}%"
  329. loop {_ThisTeam::*}:
  330. set {Teams.InTeam::%loop-value%} to {_TeamNumber}
  331. add "%loop-value%" to {Team.%{_TeamNumber}%::*}
  332. command "/scoreboard teams join UHC%{_TeamNumber}% %loop-value%"
  333.  
  334. set {_Buffer} to ""
  335. loop {_ThisTeam::*}:
  336. set {_Player} to ("%loop-value%" parsed as offlineplayer)
  337. if {_Player} is online:
  338. set {_Buffer} to "%{_Buffer}%§a%loop-value% "
  339. else:
  340. set {_Buffer} to "%{_Buffer}%§c%loop-value% "
  341. command "/wl add %loop-value%"
  342.  
  343. loop {_ThisTeam::*}:
  344. set {_Player} to ("%loop-value%" parsed as offlineplayer)
  345. command "/playsound note.pling %loop-value%"
  346. message "{@P} You have been put on a team with the following people!" to {_Player}
  347. message "{@P} %{_Buffer}%" to {_Player}
  348.  
  349. message "{@P} Created a team with the following members:"
  350. message "{@P} %{_Buffer}%"
  351. loop all players:
  352. loop-player has the permission "teams.createteam.notify"
  353. loop-player is not command sender
  354. message "{@P} {@N} Created team with members:" to loop-player
  355. message "{@P} %{_Buffer}%" to loop-player
  356.  
  357. command /mt <text>:
  358. permission: skript.op
  359. usage: /mt <Set/List/Give/Reset>
  360. aliases: /mt
  361. trigger:
  362. if arg 1 is "set":
  363. loop all players:
  364. if {MtTeam::%loop-player%} is not set:
  365. set {_Team} to {Teams.InTeam::%loop-player%}
  366. loop all players:
  367. loop-player-2 is not loop-player-1
  368. if {Teams.InTeam::%loop-player-2%} is equal to {_Team}:
  369. broadcast "TeamCheck"
  370. if {Team1} is not "8":
  371. broadcast "Team1Check"
  372. if {Team2} is not "8":
  373. broadcast "Team2Check"
  374. set {_RandomiserYay} to a random integer between 1 and 2
  375. broadcast "Integer and %{_RandomiserYay}%"
  376. set {MtTeam::%loop-player-2%} to {_RandomiserYay}
  377. set {MtTeam::%loop-player-1%} to {_RandomiserYay}
  378. broadcast "Var's for teams"
  379. if {_RandomiserYay} is 2:
  380. broadcast "Team2Cond"
  381. add 2 to {Team2}
  382. broadcast "Team2 is: %{Team2}%"
  383. send "{@P} You are now on the red team" to loop-player-1
  384. send "{@P} You are now on the red team" to loop-player-2
  385. else if {_RandomiserYay} is 1:
  386. broadcast "Team1Cond"
  387. add 2 to {Team1}
  388. broadcast "Team1 is: %{Team1}%"
  389. send "{@P} You are now on the blue team" to loop-player-1
  390. send "{@P} You are now on the blue team" to loop-player-2
  391. if arg 1 is "list":
  392. send "{@P} Teams"
  393. loop all players:
  394. if {MtTeam::%loop-player%} is 1:
  395. send "<blue>%loop-player%" to command sender
  396. wait 1 tick
  397. if {MtTeam::%loop-player%} is 2:
  398. send "<red>%loop-player%" to command sender
  399. if arg 1 is "clear" or "reset":
  400. set {Team1} to 0
  401. set {Team2} to 0
  402. loop all players:
  403. delete {MtTeam::%loop-player%}
  404. delete {Dead::%loop-player%}
  405. broadcast "{@P} Mystery Teams VfV Edition reset!"
  406. if arg 1 is "give":
  407. loop all players:
  408. if {MtTeam::%loop-player%} is 1:
  409. give 5 blue wool to loop-player
  410. else if {MtTeam::%loop-player%} is 2:
  411. give 5 red wool to loop-player
  412.  
  413. on death of player:
  414. set {_Team} to {Teams.InTeam::%victim%}
  415. loop all players:
  416. if {Dead::%victim%} is not set:
  417. loop-player is not victim
  418. set {Dead::%victim%} to "dead"
  419. if {Teams.InTeam::%loop-player%} is equal to {_Team}:
  420. if {Dead::%loop-player%} is set:
  421. broadcast "{@P} A pair consisting of %victim% and %loop-player% is now gone!"
  422. if {MtTeam::%loop-player%} is 1:
  423. broadcast "{@P} %victim% and %loop-player% were on <blue>Blue Team<white>!"
  424. if {MtTeam::%loop-player%} is 2:
  425. broadcast "{@P} %victim% and %loop-player% were on <red>Red Team<white>!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement