Advertisement
Guest User

Untitled

a guest
May 24th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.25 KB | None | 0 0
  1. on load:
  2.  
  3. #VARRIABLES#
  4.  
  5. if {prefix} is not set:
  6. set {prefix} to "&8&l[&5SkyWars&8&l]"
  7. if {startWaitTime} is not set:
  8. set {startWaitTime} to 2 minutes
  9. if {minPlayers} is not set:
  10. set {minPlayers} to 2
  11. if {maxPlayers} is not set:
  12. set {maxPlayers} to 12
  13. if {winTokenRewards} is not set:
  14. set {winTokenRewards} to 10
  15. if {looseTokenRewards} is not set:
  16. set {looseTokenRewards} to -1
  17. if {killTokenRewards} is not set:
  18. set {killTokenRewards} to 1
  19.  
  20. #CONFIG.YML#
  21. if file "../../AmazingSkyWars/config.yml" does not exists:
  22. create file "../../AmazingSkyWars/config.yml"
  23. if file "../../AmazingSkyWars/arenas.yml" does not exists:
  24. create file "../../AmazingSkyWars/arenas.yml"
  25.  
  26. set yaml value "Prefix" from file "../../AmazingSkyWars/config.yml" to "%{prefix}% ##Sets the prefix of AmazingSkyWars"
  27. set yaml value "Start Time" from file "../../AmazingSkyWars/config.yml" to "%{startWaitTime}% ##Sets how long you have to wait before the arena starts"
  28. set yaml value "Minimum Players" from file "../../AmazingSkyWars/config.yml" to "%{minPlayers}% ##Sets the default minimum amount of players in an arena"
  29. set yaml value "Maximum Players" from file "../../AmazingSkyWars/config.yml" to "%{maxPlayers}% ##Sets the default maximum amount of players in an arena"
  30. set yaml value "Win Token Rewards" from file "../../AmazingSkyWars/config.yml" to "%{winTokenRewards}% ##Sets the amount of tokens the winner of a game receives"
  31. set yaml value "Loose Token Rewards" from file "../../AmazingSkyWars/config.yml" to "%{looseTokenRewards}% ##Sets the amount of tokens the looser(s) of a game receives (or gets taken)"
  32. set yaml value "Kill Token Rewards" from file "../../AmazingSkyWars/config.yml" to "%{killTokenRewards}% ##Sets the amount of tokens a player receives when they kill another player"
  33.  
  34. #SELECTION WAND#
  35. on left click with stick:
  36. if name of item contains "&9&lSkyWars Selection Wand":
  37. if player has permission "asw.admin":
  38. cancel event
  39. wait 2 ticks
  40. set {wand.pos1} to location of clicked block
  41. send "&bPos1 set to %{wand.pos1}%" to player
  42. else:
  43. send "&cYou do not have permission to use this command!" to sender
  44. on right click with stick:
  45. if name of item contains "&9&lSkyWars Selection Wand":
  46. if player has permission "asw.admin":
  47. cancel event
  48. wait 2 ticks
  49. set {wand.pos2} to location of clicked block
  50. send "&ePos2 set to %{wand.pos2}%" to player
  51. else:
  52. send "&cYou do not have permission to use this command!" to sender
  53.  
  54. #COMMANDS#
  55.  
  56. command /amazingskywars [<text>] [<text>] [<text>]:
  57. description: The main command for AmazingSkyWars
  58. aliases: /sw, /asw, /swars
  59. usage: /amazingskywars [arg 1] [arg 2] [arg 3]
  60. executable by: console and players
  61. trigger:
  62. if sender is in world "skywars":
  63. #/sw help#
  64. if sender has permission "asw.help":
  65. if sender does not have permission "asw.admin":
  66. if arg 1 is not set:
  67. wait 2 ticks
  68. send "&8&l===========&1&l[&9SkyWars&1&l]&8&l===========" to sender
  69. send "&a/sw help [page]&7: Shows the help page" to sender
  70. send "&a/sw join [arena name]&7: Join a game" to sender
  71. send "&a/sw kit [kit]&7: Choose a kit" to sender
  72. send "&a/sw leave&7: Leaves the game you joined" to sender
  73. send "&a/sw glass&7: Chooses your glass color" to sender
  74. send "&a/sw shop&7: Opens the shop GUI" to sender
  75. send "&8&l=============&1&l[&91/2&1&l]&8&l============" to sender
  76. stop trigger
  77. if arg 1 is "help":
  78. if arg 2 is not set:
  79. wait 2 ticks
  80. send "&8&l===========&1&l[&9SkyWars&1&l]&8&l===========" to sender
  81. send "&a/sw help [page]&7: Shows the help page" to sender
  82. send "&a/sw join [arena name]&7: Join a game" to sender
  83. send "&a/sw kit [kit]&7: Choose a kit" to sender
  84. send "&a/sw leave&7: Leaves the game you joined" to sender
  85. send "&a/sw glass&7: Chooses your glass color" to sender
  86. send "&a/sw shop&7: Opens the shop GUI" to sender
  87. send "&8&l=============&1&l[&91/2&1&l]&8&l============" to sender
  88. stop trigger
  89. if arg 1 is "help":
  90. if arg 2 is "1":
  91. wait 2 ticks
  92. send "&8&l===========&1&l[&9SkyWars&1&l]&8&l===========" to sender
  93. send "&a/sw help [page]&7: Shows the help page" to sender
  94. send "&a/sw join [arena name]&7: Join a game" to sender
  95. send "&a/sw kit [kit]&7: Choose a kit" to sender
  96. send "&a/sw leave&7: Leaves the game you joined" to sender
  97. send "&a/sw glass [color]&7: Chooses your glass color" to sender
  98. send "&a/sw shop&7: Opens the shop GUI" to sender
  99. send "&8&l=============&1&l[&91/2&1&l]&8&l============" to sender
  100. stop trigger
  101. if arg 1 is "help":
  102. if arg 2 is "2":
  103. wait 2 ticks
  104. send "&8&l===========&1&l[&9SkyWars&1&l]&8&l===========" to sender
  105. send "&a/sw togglescoreboard&7: Toggles the scoreboard" to sender
  106. send "&a/sw stats [player]&7: Shows a player's stats" to sender
  107. send "&a/sw togglemessages&7: Toggles all skywars messages" to sender
  108. send "&a/sw spec <arena>&7: Spectate a game" to sender
  109. send "&a/sw togglefireworks&7: Toggles the win fireworks" to sender
  110. send "&a/sw toggledeathscreen&7: Toggle the death screen" to sender
  111. send "&8&l=============&1&l[&92/2&1&l]&8&l============" to sender
  112. stop trigger
  113. if arg 1 is "help":
  114. if arg 2 is set:
  115. if arg 2 is not an integer:
  116. send "%{prefix}% &cArgument 2 must be an integer!" to sender
  117. stop trigger
  118. else:
  119. if arg 2 is not "1" or "2":
  120. send "%{prefix}% &cThere is no page number %arg 2%" to sender
  121. stop trigger
  122. else:
  123. send "&cYou do not have permission to use this command!" to sender
  124. if sender has permission "asw.admin":
  125. if arg 1 is not set:
  126. wait 2 ticks
  127. send "&8&l===========&1&l[&9SkyWars&1&l]&8&l===========" to sender
  128. send "&a/sw help [page]&7: Shows the help page" to sender
  129. send "&a/sw join [arena name]&7: Join a game" to sender
  130. send "&a/sw kit [kit]&7: Choose a kit" to sender
  131. send "&a/sw leave&7: Leaves the game you joined" to sender
  132. send "&a/sw glass&7: Chooses your glass color" to sender
  133. send "&a/sw shop&7: Opens the shop GUI" to sender
  134. send "&8&l=============&1&l[&91/5&1&l]&8&l============" to sender
  135. stop trigger
  136. if arg 1 is "help":
  137. if arg 2 is not set:
  138. wait 2 ticks
  139. send "&8&l===========&1&l[&9SkyWars&1&l]&8&l===========" to sender
  140. send "&a/sw help [page]&7: Shows the help page" to sender
  141. send "&a/sw join [arena name]&7: Join a game" to sender
  142. send "&a/sw kit [kit]&7: Choose a kit" to sender
  143. send "&a/sw leave&7: Leaves the game you joined" to sender
  144. send "&a/sw glass&7: Chooses your glass color" to sender
  145. send "&a/sw shop&7: Opens the shop GUI" to sender
  146. send "&8&l=============&1&l[&91/5&1&l]&8&l============" to sender
  147. stop trigger
  148. if arg 1 is "help":
  149. if arg 2 is "1":
  150. wait 2 ticks
  151. send "&8&l===========&1&l[&9SkyWars&1&l]&8&l===========" to sender
  152. send "&a/sw help [page]&7: Shows the help page" to sender
  153. send "&a/sw join [arena name]&7: Join a game" to sender
  154. send "&a/sw kit [kit]&7: Choose a kit" to sender
  155. send "&a/sw leave&7: Leaves the game you joined" to sender
  156. send "&a/sw glass [color]&7: Chooses your glass color" to sender
  157. send "&a/sw shop&7: Opens the shop GUI" to sender
  158. send "&8&l=============&1&l[&91/5&1&l]&8&l============" to sender
  159. stop trigger
  160. if arg 1 is "help":
  161. if arg 2 is "2":
  162. wait 2 ticks
  163. send "&8&l===========&1&l[&9SkyWars&1&l]&8&l===========" to sender
  164. send "&a/sw togglescoreboard&7: Toggles the scoreboard" to sender
  165. send "&a/sw stats [player]&7: Shows a player's stats" to sender
  166. send "&a/sw togglemessages&7: Toggles all skywars messages" to sender
  167. send "&a/sw spec <arena>&7: Spectate a game" to sender
  168. send "&a/sw togglefireworks&7: Toggles the win fireworks" to sender
  169. send "&a/sw toggledeathscreen&7: Toggle the death screen" to sender
  170. send "&8&l=============&1&l[&92/5&1&l]&8&l============" to sender
  171. stop trigger
  172. if arg 1 is "help":
  173. if arg 2 is "3":
  174. wait 2 ticks
  175. send "&8&l===========&1&l[&9SkyWars&1&l]&8&l===========" to sender
  176. send "&a/sw arenalist&7: Lists all arenas" to sender
  177. send "&a/sw wand&7: Gives you the skywars wand" to sender
  178. send "&a/sw create <arena name>&7: Creates an arena" to sender
  179. send "&a/sw remove <arena name>&7: Removes an arena" to sender
  180. send "&a/sw setspawn <arena name> <spawn number>&7: Sets the spawn points" to sender
  181. send "&a/sw setminplayers <arena name> <min-amount>&7: Set the minimum amount of players" to sender
  182. send "&8&l=============&1&l[&93/5&1&l]&8&l============" to sender
  183. stop trigger
  184. if arg 1 is "help":
  185. if arg 2 is "4":
  186. wait 2 ticks
  187. send "&8&l===========&1&l[&9SkyWars&1&l]&8&l===========" to sender
  188. send "&a/sw forcestart <arena>&7: Force starts an arena" to sender
  189. send "&a/sw reload&7: Reloads the plugin" to sender
  190. send "&a/sw listplayers <arena name>&7: Shows the players in an arena" to sender
  191. send "&a/sw searchplayer <player name>&7: Finds a player" to sender
  192. send "&a/sw disable <arena name>&7: Disables an arena" to sender
  193. send "&a/sw enable <arena name>&7: Enables an arena" to sender
  194. send "&8&l=============&1&l[&94/5&1&l]&8&l============" to sender
  195. stop trigger
  196. if arg 1 is "help":
  197. if arg 2 is "5":
  198. wait 2 ticks
  199. send "&8&l===========&1&l[&9SkyWars&1&l]&8&l===========" to sender
  200. send "&a/sw setlobby&7: Sets the lobby" to sender
  201. send "&c--------" to sender
  202. send "&c--------" to sender
  203. send "&c--------" to sender
  204. send "&c--------" to sender
  205. send "&c--------" to sender
  206. send "&8&l=============&1&l[&95/5&1&l]&8&l============" to sender
  207. stop trigger
  208. if arg 1 is "help":
  209. if arg 2 is set:
  210. if arg 2 is not an integer:
  211. wait 2 ticks
  212. send "%{prefix}% &cArgument 2 must be an number 1 to 5!" to sender
  213. stop trigger
  214. else:
  215. send "&cYou do not have permission to use this command!" to sender
  216. #/sw wand#
  217. if arg 1 is "wand":
  218. if arg 2 is not set:
  219. wait 2 ticks
  220. give 1 stick named "&9&lSkyWars Selection Wand" with lore "&eLeft click to set pos 1 &9| &eRight click to set pos2 " to player
  221. #/sw create#
  222. if sender has permission "asw.admin":
  223. if arg 1 is "create":
  224. if arg 2 is set:
  225. if {wand.pos1} is set:
  226. if {wand.pos2} is set:
  227. wait 2 ticks
  228. set {arenaName} to arg 2
  229. set yaml value "Arenas.%{arenaName}%.Region.Pos1" from file "../../AmazingSkyWars/arenas.yml" to "%{wand.pos1}%"
  230. set yaml value "Arenas.%{arenaName}%.Region.Pos2" from file "../../AmazingSkyWars/arenas.yml" to "%{wand.pos2}%"
  231. set yaml value "Arenas.%{arenaName}%.Options.Min-Players" from file "../../AmazingSkyWars/arenas.yml" to "%{minPlayers}%"
  232. set yaml value "Arenas.%{arenaName}%.Options.Max-Players" from file "../../AmazingSkyWars/arenas.yml" to "%{maxPlayers}%"
  233. set yaml value "Arenas.%{arenaName}%.Options.Start-Wait-Time" from file "../../AmazingSkyWars/arenas.yml" to "%{startWaitTime}%"
  234. set yaml value "Arenas.%{arenaName}%.Options.Win-Reward" from file "../../AmazingSkyWars/arenas.yml" to "%{winTokenRewards}%"
  235. send "&aArena %{arenaName}% created successfully."
  236. else:
  237. wait 2 ticks
  238. send "%{prefix}% &cYou need to set &ePos2 &cbefore you create an arena!" to sender
  239. else:
  240. wait 2 ticks
  241. send "%{prefix}% &cYou need to set &bPos1 &cbefore you create an arena!" to sender
  242. else:
  243. wait 2 ticks
  244. send "%{prefix}% &cYou need to add an arena name!"
  245. else:
  246. wait 2 ticks
  247. send "&cYou do not have permission to use this command!" to sender
  248. #/sw setspawn#
  249. if sender has permission "asw.admin":
  250. if arg 1 is "setspawn":
  251. if arg 2 is set:
  252. if arg 3 is set:
  253. if arg 3 is a number:
  254. set {arenaName} to arg 2
  255. set {spawnNumber} to arg 3
  256. set {spawnPos} to location of player
  257. set yaml value "Arenas.%{arenaName}%.Spawns.%{spawnNumber}%" from file "../../AmazingSkyWars/arenas.yml" to "%{spawnPos}%"
  258. send "%{prefix}% &aSpawn %arg 3% was set successfully!"
  259. if arg 3 is not a number:
  260. send "%{prefix}% &cArgument 3 needs to be a number!" to sender
  261. else:
  262. send "%{prefix}% &cYou need to state a spawn number!" to sender
  263. else:
  264. send "%{prefix}% &cYou need to state an arena!" to sender
  265. else:
  266. send "&cYou do not have permission to use this command!" to sender
  267. #/sw remove#
  268. if sender has permission "asw.admin":
  269. if arg 1 is "remove":
  270. if arg 2 is set:
  271. wait 2 ticks
  272. set {arenaName} to arg 2
  273. delete yaml value "Arenas.%{arenaName}%.Region.Pos1" from file "../../AmazingSkyWars/arenas.yml"
  274. delete yaml value "Arenas.%{arenaName}%.Region.Pos2" from file "../../AmazingSkyWars/arenas.yml"
  275. delete yaml value "Arenas.%{arenaName}%.Options.Min-Players" from file "../../AmazingSkyWars/arenas.yml"
  276. delete yaml value "Arenas.%{arenaName}%.Options.Max-Players" from file "../../AmazingSkyWars/arenas.yml"
  277. delete yaml value "Arenas.%{arenaName}%.Options.Start-Wait-Time" from file "../../AmazingSkyWars/arenas.yml"
  278. delete yaml value "Arenas.%{arenaName}%.Options.Win-Reward" from file "../../AmazingSkyWars/arenas.yml"
  279. send "&aArena &9%{arenaName}% &aremoved successfully."
  280. else:
  281. wait 2 ticks
  282. send "%{prefix}% &cYou need to state an arena!" to sender
  283. else:
  284. wait 2 ticks
  285. send "&cYou do not have permission to use this command!" to sender
  286. else:
  287. wait 2 ticks
  288. send "&cYou can not use this command in this world"
  289.  
  290.  
  291. command /testcmd:
  292. trigger:
  293. wait 2 ticks
  294. send "%{prefix}%" to sender
  295. send "%{startWaitTime}%" to sender
  296. send "%{minPlayers}%" to sender
  297. send "%{maxPlayers}%" to sender
  298. send "%{winTokenRewards}%" to sender
  299. send "%{looseTokenRewards}%" to sender
  300. send "%{killTokenRewards}%" to sender
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement