Komandir

Untitled

Jul 13th, 2020
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 64.35 KB | None | 0 0
  1. #Made By Uzumaki
  2. #Made it Octomber 2017 so don't blame me for low quality code.
  3.  
  4. options:
  5. plugin-version: 0.0.1
  6.  
  7.  
  8.  
  9. #
  10. # ● SETTINGS ●
  11. #
  12.  
  13. prefix: &6&lLuckyRace &8&l»&7
  14. onlyingamecommands: true
  15. ingamecommands: "leave" or "lobby" or "hub" or "msg" or "tell" or "w" or "lucky"
  16. useluckyblockplugin: false
  17.  
  18. #Timers
  19. waitingtime: 10 #seconds, before game starts
  20. gameminutes: 10 #minutes, in game time
  21. winlenght: 8 #seconds, until arena restart after win.
  22. shorttimeto: 30 #seconds, after first player reach to finish.
  23.  
  24. #Coins
  25.  
  26. coinsperkill: 5
  27. coinsperwin: 100
  28. reachfinal: 50
  29. allownegativecoins: false
  30.  
  31.  
  32. #Chat
  33. normalchat: "&7%player's displayname% &8&l» &7%message%"
  34. specchat: "&7%player's displayname% &8&l» &7 %message%"
  35.  
  36.  
  37.  
  38.  
  39. #
  40. # ● SCOREBOARD ●
  41. #
  42.  
  43. websitename: &e&l> BLOODMC.TRADEMC.ORG
  44.  
  45.  
  46.  
  47. #
  48. # ● GAME STAGE NAMES ●
  49. #
  50.  
  51. waiting: &a&lLobby
  52. ingame: &aInGame
  53. starting: &a&lStarting
  54. deathmatch: &a&lDeathmatch
  55. restarting: &c&lEndGame
  56. full: &c&lFULL
  57.  
  58.  
  59. #
  60. # ● TITLES ●
  61. #
  62.  
  63. winnertitle: &3&lТы выйграл!
  64. winnersubtitle: &7Ты остался один, кто стоит на ногах!
  65. deathtitle: &4&lВы проиграли!
  66. deathsubtitle: &7Вы стали наблюдателем!
  67. startingtitle: &c&l%{_sec}%
  68. startingsubtitle: &eИгра начинается!
  69. finishtitle: &6&lТы финишировал!
  70. finishsubtitle: &cСейчас пройдёт финальныя схватка!
  71.  
  72.  
  73. #
  74. # ● MESSAGESS ●
  75. #
  76.  
  77.  
  78. startingin: &7Старт через %{_sec}% &7секунд!
  79.  
  80. startmessage: &a&lИГРА НАЧАЛАСЬ, ВСЕМ УДАЧИ!
  81.  
  82. joinmessage: &7%player's displayname% &6Присоединился к игре.
  83.  
  84. leftmessage: &7%player's displayname% &6Покинул игру.
  85.  
  86. youarespec: &7&lВы стали наблюдателем.
  87.  
  88. deathmessage: &c&l» &7%victim's displayname% был убит &7%attacker's displayname%
  89.  
  90. deathmatchstarted: &cDEATHMATCH НАЧАЛСЯ!
  91.  
  92. notinarenaregion: &7Вы не находитесь на регионе арены, вы получите &4урон&3!
  93.  
  94. checkpoint: &e&l» &a&lЧекпоинт достигнут &9● &6&l! &e&l«
  95.  
  96. finishmessage: &e&l» &a&l%{_p}'s displayname% &6&lФинишировал &9● &6&l! &e&l«
  97.  
  98. #
  99. # ● ITEM NAMES ●
  100. #
  101.  
  102. teleporteritem: compass
  103. teleporteritemname: &a&lTeleporter
  104.  
  105. leaveitem: magma_cream
  106. leaveitemname: &6&lLeave The Game
  107.  
  108.  
  109. #
  110. # ● SIGNS ●
  111. #
  112.  
  113. signline1: &6&lLuckyRace
  114.  
  115. autojoinline: &c&lPlay
  116.  
  117. menuline: &3&lArenas
  118.  
  119. #
  120. # ● GUIS ●
  121. #
  122.  
  123. arenasguiname: LUCKY ARENAS
  124.  
  125. specgui: TELEPORT TO
  126.  
  127.  
  128.  
  129. on skript load:
  130. clear {LUCKY.BLOCKS::*}
  131. clear {LUCKY.CHESTS::*}
  132. wait 1 seconds
  133.  
  134.  
  135. #
  136. # ● LUCKY BLOCKS LOOT ●
  137. #
  138.  
  139. add 1 iron_sword, diamond_leggings of knockback 3, blaze_powder of fire_aspect 2, stone_sword, stone_pickaxe, iron_pickaxe, iron_axe, 1 golden_apple, 2 golden_apple,1 fishing_rod, 1 bow, 16 exp_bottle, 6 cooked_beef, 16 arrows , 1 iron_helmet, 1 iron_chestplate , 1 iron_leggings, 1 iron_boots, 1 diamond_helmet, 1 diamond_chestplate, diamond_sword of sharpness, diamond_helmet of protection 1, diamond_boots of protection 1, diamond_leggings of protection 1 and diamond_chestplate of protection 1, 1 diamond_leggings and 1 diamond_sword to {LUCKY.BLOCKS::*}
  140.  
  141.  
  142. #
  143. # ● CHEST ITEMS ●
  144. #
  145. add 1 iron_sword, stone_sword, stone_pickaxe, iron_pickaxe, iron_axe, 1 golden_apple, 2 golden_apple,1 fishing_rod, 16 snowball, 16 egg, 1 bow, 16 exp_bottle, 6 cooked_beef, 16 arrows , 1 iron_helmet, 1 iron_chestplate , 1 iron_leggings, 1 iron_boots, 1 diamond_helmet, 1 diamond_chestplate, diamond_sword of sharpness, diamond_helmet of protection 1, diamond_boots of protection 1, diamond_leggings of protection 1 and diamond_chestplate of protection 1, 1 diamond_leggings and 1 diamond_sword to {LUCKY.CHESTS::*}
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155. #
  156. # \\ CODE //
  157. #
  158.  
  159.  
  160.  
  161. on load:
  162. send "&7&l--------------------------------------------" to console
  163. send " " to console
  164. send "{@prefix} &aLoading &ev.{@plugin-version}&a..." to console
  165. wait 1 tick
  166. send "{@prefix} &e%size of {lucky.arenas::*}% &agames loaded!" to console
  167. wait 1 tick
  168. send "{@prefix} &a&lPlugin loaded!" to console
  169. send " " to console
  170. send "&7&l--------------------------------------------" to console
  171. loop {lucky.arenas::*}:
  172. lucky_resetarena(loop-value)
  173. wait 1 seconds
  174.  
  175. on unload:
  176. send "&7&l--------------------------------------------" to console
  177. send " " to console
  178. send "{@prefix} &aDisabling &ev.{@plugin-version}&a..." to console
  179. send "{@prefix} &ev.{@plugin-version} &adisabled!" to console
  180. send " " to console
  181. send "&7&l--------------------------------------------" to console
  182. stop
  183.  
  184.  
  185.  
  186. #
  187. # \\ VARIABLES MANAGER //
  188. #
  189.  
  190.  
  191.  
  192. function lucky_resetarena(arena: text):
  193. set {lucky.arena.%{_arena}%.status} to "{@restarting}"
  194. send "{@prefix} &aReseting &e%{_arena}%" to console
  195. delete {lucky.arena.%{_arena}%.CHEST::*}
  196. delete {lucky.arena.%{_arena}%.players.death::*}
  197. delete {lucky.arena.%{_arena}%.players.alive::*}
  198. delete {lucky.arena.%{_arena}%.gametime::*}
  199. delete {lucky.gamekills.%{_arena}%::*}
  200. delete {lucky.lives.%{_arena}%::*}
  201. delete {lucky.arena.%{_arena}%.respawnpoint::*}
  202. delete {lucky.checkpoints.%{_arena}%::*}
  203. set {lucky.arena.%{_arena}%.gametime::minutes} to {@gameminutes}
  204. set {lucky.arena.%{_arena}%.gametime::seconds} to 60
  205. set {lucky.arena.%{_arena}%.gametime::timefix} to ""
  206. set {lucky.arena.%{_arena}%.playing} to 0
  207. make console execute command "rb rollbackregion %{_arena}% -clearEntities"
  208. wait 10 seconds
  209. set {lucky.arena.%{_arena}%.seconds} to {@waitingtime}
  210. set {lucky.arena.%{_arena}%.status} to "{@waiting}"
  211. invoke "lucky.refreshmenu"
  212. send "{@prefix} &e%{_arena}% &areseted!" to console
  213. stop
  214.  
  215. on join:
  216. set {lucky.player.%uuid of player%.playing} to "NotInGame"
  217. if {lucky.stats.kills.%uuid of player%} is not set:
  218. set {lucky.stats.kills.%uuid of player%} to 0
  219. if {lucky.stats.deaths.%uuid of player%} is not set:
  220. set {lucky.stats.deaths.%uuid of player%} to 0
  221. if {lucky.stats.wins.%uuid of player%} is not set:
  222. set {lucky.stats.wins.%uuid of player%} to 0
  223. if {lucky.stats.coins.%uuid of player%} is not set:
  224. set {lucky.stats.coins.%uuid of player%} to 0
  225. loop all players:
  226. if {lucky.player.%uuid of loop-player%.playing} is "InGameSPEC":
  227. hide loop-player from player
  228.  
  229. #
  230. # \\ CODE //
  231. #
  232. command /lucky [<text>] [<text>] [<integer>] [<player>]:
  233. executable by: players
  234. trigger:
  235. if text arg 1 is not set:
  236. if text arg 2 is not set:
  237. if integer arg 1 is not set:
  238. if player arg 1 is not set:
  239. if player have permission "lucky.player":
  240. make player execute the command "lucky help"
  241. else:
  242. send "&cYou don't have permission to execute this command!"
  243. stop
  244. else:
  245. make player execute the command "lucky"
  246. stop
  247. else:
  248. make player execute the command "lucky"
  249. stop
  250. else:
  251. make player execute the command "lucky"
  252. stop
  253. if text arg 1 is "help":
  254. if arg-2 is not set:
  255. if player has permission "lucky.player":
  256. make player execute command "lucky help player"
  257. stop
  258. if player has permission "lucky.admin":
  259. make player execute command "lucky help admin"
  260. stop
  261. if arg-2 is set:
  262. if text arg 2 is "player" or "admin":
  263. play sound "ORB_PICKUP" to player with volume 100.0 and pitch 100.0
  264. if text arg 2 is "player":
  265. send "&7&l■■■■■■■■■&8[ {@prefix} &8]&7&l■■■■■■■■■ "
  266. send "&8&l» &7/lucky list "
  267. send "&8&l» &7/lucky join &8(&7arena_name&8) "
  268. send "&8&l» &7/lucky stats "
  269. send "&8&l» &7/lucky autojoin "
  270. send "&8&l» &7/lucky leave "
  271. send "&7&l■■■■■■■■■■■■■■■■■■■■■■■■■■"
  272. stop
  273. if text arg 2 is "admin":
  274. send "&7&l■■■■■■■■■&8[ {@prefix} &8]&7&l■■■■■■■■■ "
  275. send "&8&l» &c/lucky setlobby "
  276. send "&8&l» &c/lucky createArena &8(&7arena_name&8) "
  277. send "&8&l» &c/lucky deleteArena &8(&7arena_name&8) "
  278. send "&8&l» &c/lucky addSpawn &8(&7arena_name&8) "
  279. send "&8&l» &c/lucky removeSpawn &8(&7arena_name&8) "
  280. send "&8&l» &c/lucky adddmSpawn &8(&7arena_name&8) "
  281. send "&8&l» &c/lucky removedmSpawn &8(&7arena_name&8) "
  282. send "&8&l» &c/lucky saveArena &8(&7arena_name&8) "
  283. send "&8&l» &c/lucky setarenalobby &8(&7arena_name&8) "
  284. send "&8&l» &c/lucky Max &8(&7arena_name&8) &8(&7number&8) "
  285. send "&8&l» &c/lucky Min &8(&7arena_name&8) &8(&7number&8) "
  286. send "&8&l» &c/lucky coins take/set/give &8(&7player&8) "
  287. send "&8&l» &c/lucky resetstats &8(&7player&8) "
  288. send "&7&l■■■■■■■■■■■■■■■■■■■■■■■■■■ "
  289. stop
  290. else:
  291. send "{@prefix} &7/lucky help &8Player&7 | &cAdmin"
  292. stop
  293. if text arg 1 is "autojoin":
  294. if player have permission "lucky.player":
  295. if size of {lucky.arenas::*} is not 0:
  296. send "&7Searching for available arenas..."
  297. loop {lucky.arenas::*}:
  298. if {lucky.arena.%loop-value%.status} is "{@waiting}" or "{@starting}":
  299. send "&7Arena founded!"
  300. make player execute the command "/lucky join %loop-value%"
  301. stop loop
  302. stop
  303.  
  304. else:
  305. send "&7No arenas available for now!"
  306. stop
  307. else:
  308. send "&cYou don't have permission to execute this command!"
  309. stop
  310. if text arg 1 is not "autojoin" or "list" or "setLobby" or "join" or "createArena" or "deleteArena" or "addSpawn" or "removeSpawn" or "setHighBound" or "setLowBound" or "saveArena" or "max" or "min" or "resetstats" or "stats" or "leave" or "adddmSpawn" or "removedmSpawn" or "coins" or "setarenalobby" or "setfallpoint":
  311. make player execute the command "lucky"
  312. stop
  313. if text arg 1 is "setlobby":
  314. if player have permission "lucky.admin":
  315. if {lucky.player.%uuid of player%.playing} is "NotInGame":
  316. set {lucky.lobby} to the player's location
  317. send "&c&lSETUP &e&l» &7Setted the &aLobby &7to your current location!"
  318. play sound "LEVEL_UP" to player with volume 100.0 and pitch 100.0
  319. stop
  320. else:
  321. send "&cYou can't change the Lobby location while playing!"
  322. stop
  323. else:
  324. send "&cYou don't have permission to execute this command!"
  325. stop
  326. if text arg 1 is "join":
  327. if {lucky.player.%uuid of player%.playing} is "NotInGame":
  328. if text arg 2 is set:
  329. if {lucky.arena.%text arg 2%.created} is true:
  330. if {lucky.arena.%text arg 2%.saved} is true:
  331. if {lucky.arena.%text arg 2%.status} is "{@waiting}" or "{@starting}":
  332. invoke "lucky.clearplayer" from player
  333. add 1 to {lucky.arena.%text arg 2%.playing}
  334. add player to {lucky.arena.%text arg 2%.players.alive::*}
  335. set {lucky.player.%uuid of player%.playing} to "InGame"
  336. set {lucky.player.%uuid of player%.arena} to text arg 2
  337. set {lucky.gamekills.%{lucky.player.%uuid of player%.arena}%::%player%} to 0
  338. invoke "lucky.refreshmenu"
  339. invoke "lucky.join" from text arg 2
  340. teleport player to {lucky.arena.%text arg 2%.lobby}
  341. set player's slot 8 to {@leaveitem} named "{@leaveitemname}"
  342. send "{@joinmessage}" to {lucky.arena.%text arg 2%.players.alive::*}
  343. stop
  344. if {lucky.arena.%text arg 2%.status} is "{@full}":
  345. send "&cThis arena is full of players!"
  346. stop
  347. if {lucky.arena.%text arg 2%.status} is "{@ingame}":
  348. send "&8&l● &cYou can join while game is running"
  349. stop
  350. if {lucky.arena.%text arg 2%.status} is "{@restarting}":
  351. send "&cThis arena is currently being restarted!"
  352. stop
  353. else:
  354. send "{@prefix} &7Error founded!"
  355. send "&8&l● &3Error 5.0.2 RasenShuriken"
  356. stop
  357. else:
  358. send "&cThis arena hasn't been saved!"
  359. stop
  360. else:
  361. send "&cThis arena doesn't exists!"
  362. stop
  363. else:
  364. send "&cYou must specify an arena name!"
  365. stop
  366. else:
  367. send "&cYou can't execute this command while playing!"
  368. stop
  369. if text arg 1 is "list":
  370. if player have permission "lucky.player":
  371. if size of {lucky.arenas::*} is not 0:
  372. send "&7Loading arenas..."
  373. set {_lucky.list} to 0
  374. if size of {lucky.arenas::*} <= 9:
  375. set {_list.size} to 1
  376. if size of {lucky.arenas::*} >= 9:
  377. set {_list.size} to 2
  378. if size of {lucky.arenas::*} >= 18:
  379. set {_list.size} to 3
  380. if size of {lucky.arenas::*} >= 27:
  381. set {_list.size} to 4
  382. if size of {lucky.arenas::*} >= 36:
  383. set {_list.size} to 5
  384. open virtual chest inventory with size {_list.size} named "{@arenasguiname}" to player
  385. wait 1 tick
  386. loop {lucky.arenas::*}:
  387. if {lucky.arena.%loop-value%.status} is "{@ingame}" or "{@full}" or "{@restarting}":
  388. make a gui slot {_lucky.list} of player with red clay named "&8 " with lore "&8&l» &7Name&8: &e&l%loop-value%||||&8&l» &7Status&8: %{lucky.arena.%loop-value%.status}%||||&8&l» &7Players&8: &7%{lucky.arena.%loop-value%.playing}%/%{lucky.arena.%loop-value%.max}%||||&8&l● &7&lClick to spectate!" to run player command "lucky join %loop-value%"
  389. add 1 to {_lucky.list}
  390. else:
  391. make a gui slot {_lucky.list} of player with green clay named "&8 " with lore "&8&l» &7Name&8: &e&l%loop-value%||||&8&l» &7Status&8: %{lucky.arena.%loop-value%.status}%||||&8&l» &7Players&8: &7%{lucky.arena.%loop-value%.playing}%/%{lucky.arena.%loop-value%.max}%||||&8&l● &7&lClick to join!" to run player command "lucky join %loop-value%"
  392. add 1 to {_lucky.list}
  393. stop
  394. else:
  395. send "&cYou haven't created or saved any arena so there are any arenas to display!"
  396. stop
  397. if text arg 1 is "createArena":
  398. if player have permission "lucky.admin":
  399. if text arg 2 is set:
  400. if {lucky.player.%uuid of player%.playing} is "NotInGame":
  401. if {lucky.arena.%text arg 2%.created} is not set:
  402. set {lucky.arena.%text arg 2%.created} to true
  403. set {lucky.arena.%text arg 2%.saved} to false
  404. set {lucky.arena.%text arg 2%.spawn.id} to 0
  405. set {lucky.arena.%uuid of player%.creating} to text arg-2
  406. clear player's inventory
  407. send "&c&lSETUP &e&l» &7The arena &a%text arg 2% &7has been successfully created!"
  408. set slot 0 of player to green clay named "&7SET LOWBOUND &cAND &7SET HIGHBOUND"
  409. set slot 1 of player to yellow clay named "&7ADD SPAWN &aAND &7REMOVE SPAWN"
  410. set slot 2 of player to green clay named "&7ADD &cDM SPAWN &aAND &7REMOVE &cDM &7SPAWN"
  411. set slot 3 of player to clay ball named "&7SET ARENA &cLOBBY"
  412. set slot 4 of player to clay ball named "&7SET ARENA &cFALL POINT"
  413. set slot 5 of player to yellow clay named "&7SET &cMIN PLAYERS"
  414. set slot 6 of player to yellow clay named "&7SET &cMAX PLAYERS"
  415. set slot 7 of player to green clay named "&7ARENA &c%{lucky.arena.%uuid of player%.creating}%"
  416. set slot 8 of player to red clay named "&c&lSAVE ARENA"
  417. stop
  418. else:
  419. send "&cThis arena has already been created!"
  420. stop
  421. else:
  422. send "&cYou can't do this while playing!"
  423. stop
  424. else:
  425. send "&cYou must specify an arena name!"
  426. stop
  427. else:
  428. send "&cYou don't have permission to execute this command!"
  429. stop
  430. if text arg 1 is "deleteArena":
  431. if player have permission "lucky.admin":
  432. if text arg 2 is set:
  433. if {lucky.player.%uuid of player%.playing} is "NotInGame":
  434. if {lucky.arena.%text arg 2%.created} is true:
  435. if {lucky.arena.%text arg 2%.playing} is 0:
  436. delete {lucky.arena.%text arg 2%.created}
  437. delete {lucky.arena.%text arg 2%.saved}
  438. delete {lucky.arena.%text arg 2%.status}
  439. delete {lucky.arena.%text arg 2%.max}
  440. delete {lucky.arena.%text arg 2%.min}
  441. delete {lucky.arena.%text arg 2%.spawn.id}
  442. delete {lucky.arena.%text arg 2%.playing}
  443. delete {lucky.arena.%text arg 2%.players.alive::*}
  444. delete {lucky.arena.%text arg 2%.players.death::*}
  445. delete {lucky.arena.%text arg 2%.created}
  446. delete {lucky.arena.%text arg 2%.saved}
  447. delete {lucky.arena.%text arg 2%.lobby}
  448. delete {lucky.arena.%text arg 2%.gametime::*}
  449. delete {lucky.arena.%text arg 2%.dm.id}
  450. delete {lucky.lives.%text arg 2%::*}
  451. delete {lucky.checkpoints.%text arg 2%::*}
  452. delete {lucky.arena.%text arg 2%.fallpoint}
  453. delete {lucky.gamekills.%text arg 2%::*}
  454. delete {lucky.arena.%text arg 2%.CHEST::*}
  455. remove text arg 2 from {lucky.arenas::*}
  456. send "&c&lSETUP &e&l» &7The arena &c%text arg 2% &7has been successfully deleted!"
  457. stop
  458. else:
  459. send "&cThere are still players playing in the arena!"
  460. stop
  461. else:
  462. send "&cThis arena doesn't even exists!"
  463. stop
  464. else:
  465. send "&cYou can't do this while playing!"
  466. stop
  467. else:
  468. send "&cYou must specify an arena name!"
  469. stop
  470. else:
  471. send "&cYou don't have permission to execute this command!"
  472. stop
  473. if text arg 1 is "adddmSpawn":
  474. if player have permission "lucky.admin":
  475. if text arg 2 is set:
  476. if integer arg 1 is not set:
  477. if {lucky.player.%uuid of player%.playing} is "NotInGame":
  478. if {lucky.arena.%text arg 2%.created} is true:
  479. add 1 to {lucky.arena.%text arg 2%.dm.id}
  480. set {lucky.arena.%text arg 2%.dm.%{lucky.arena.%text arg 2%.dm.id}%} to location of player
  481. send "&c&lSETUP &e&l» &7DM,Spawn &anº%{lucky.arena.%text arg 2%.dm.id}% &7has been set!"
  482. play sound "LEVEL_UP" to player with volume 100.0 and pitch 100.0
  483. stop
  484. else:
  485. send "&cThis arena doesn't even exists!"
  486. stop
  487. else:
  488. send "&cYou can't do this while playing!"
  489. stop
  490. else:
  491. send "&cYou don't need to specify a number!"
  492. stop
  493. else:
  494. send "&cYou must specify an arena name!"
  495. stop
  496. else:
  497. send "&cYou don't have permission to execute this command!"
  498. stop
  499. if text arg 1 is "removedmSpawn":
  500. if player have permission "lucky.admin":
  501. if text arg 2 is set:
  502. if integer arg 1 is not set:
  503. if {lucky.player.%uuid of player%.playing} is "NotInGame":
  504. if {lucky.arena.%text arg 2%.created} is true:
  505. if {lucky.arena.%text arg 2%.dm.id} is not 0:
  506. send "&c&lSETUP &e&l» &7DM, Spawn &anº%{lucky.arena.%text arg 2%.dm.id}% &7has been deleted!"
  507. delete {lucky.arena.%text arg 2%.dm.%{lucky.arena.%text arg 2%.dm.id}%}
  508. remove 1 from {lucky.arena.%text arg 2%.dm.id}
  509. play sound "ANVIL_BREAK" to player with volume 100.0 and pitch 100.0
  510. stop
  511. else:
  512. send "&cThere is no more spawns to remove!"
  513. stop
  514. else:
  515. send "&cThis arena doesn't even exists!"
  516. stop
  517. else:
  518. send "&cYou can't do this while playing!"
  519. stop
  520. else:
  521. send "&cYou don't need to specify a number!"
  522. stop
  523. else:
  524. send "&cYou must specify an arena name!"
  525. stop
  526. else:
  527. send "&cYou don't have permission to execute this command!"
  528. stop
  529. if text arg 1 is "addSpawn":
  530. if player have permission "lucky.admin":
  531. if text arg 2 is set:
  532. if integer arg 1 is not set:
  533. if {lucky.player.%uuid of player%.playing} is "NotInGame":
  534. if {lucky.arena.%text arg 2%.created} is true:
  535. add 1 to {lucky.arena.%text arg 2%.spawn.id}
  536. set {lucky.arena.%text arg 2%.spawn.%{lucky.arena.%text arg 2%.spawn.id}%} to location of player
  537. send "&c&lSETUP &e&l» &7Spawn &anº%{lucky.arena.%text arg 2%.spawn.id}% &7has been set!"
  538. play sound "LEVEL_UP" to player with volume 100.0 and pitch 100.0
  539. stop
  540. else:
  541. send "&cThis arena doesn't even exists!"
  542. stop
  543. else:
  544. send "&cYou can't do this while playing!"
  545. stop
  546. else:
  547. send "&cYou don't need to specify a number!"
  548. stop
  549. else:
  550. send "&cYou must specify an arena name!"
  551. stop
  552. else:
  553. send "&cYou don't have permission to execute this command!"
  554. stop
  555. if text arg 1 is "removeSpawn":
  556. if player have permission "lucky.admin":
  557. if text arg 2 is set:
  558. if integer arg 1 is not set:
  559. if {lucky.player.%uuid of player%.playing} is "NotInGame":
  560. if {lucky.arena.%text arg 2%.created} is true:
  561. if {lucky.arena.%text arg 2%.spawn.id} is not 0:
  562. send "&c&lSETUP &e&l» &7Spawn &anº%{lucky.arena.%text arg 2%.spawn.id}% &7has been deleted!"
  563. delete {lucky.arena.%text arg 2%.spawn.%{lucky.arena.%text arg 2%.spawn.id}%}
  564. remove 1 from {lucky.arena.%text arg 2%.spawn.id}
  565. play sound "ANVIL_BREAK" to player with volume 100.0 and pitch 100.0
  566. stop
  567. else:
  568. send "&cThere is no more spawns to remove!"
  569. stop
  570. else:
  571. send "&cThis arena doesn't even exists!"
  572. stop
  573. else:
  574. send "&cYou can't do this while playing!"
  575. stop
  576. else:
  577. send "&cYou don't need to specify a number!"
  578. stop
  579. else:
  580. send "&cYou must specify an arena name!"
  581. stop
  582. else:
  583. send "&cYou don't have permission to execute this command!"
  584. stop
  585. if text arg 1 is "setarenalobby":
  586. if player have permission "lucky.admin":
  587. if text arg 2 is set:
  588. if integer arg 1 is not set:
  589. if {lucky.player.%uuid of player%.playing} is "NotInGame":
  590. if {lucky.arena.%text arg 2%.created} is true:
  591. set {lucky.arena.%text arg 2%.lobby} to location of player
  592. send "&c&lSETUP &e&l» &7Setted the &aArena Lobby &7to your current location!"
  593. play sound "LEVEL_UP" to player with volume 100.0 and pitch 100.0
  594. stop
  595. else:
  596. send "&cThis arena doesn't even exists!"
  597. stop
  598. else:
  599. send "&cYou can't do this while playing!"
  600. stop
  601. else:
  602. send "&cYou don't need to specify a number!"
  603. stop
  604. else:
  605. send "&cYou must specify an arena name!"
  606. stop
  607. else:
  608. send "&cYou don't have permission to execute this command!"
  609. stop
  610. if text arg 1 is "saveArena":
  611. if player have permission "lucky.admin":
  612. if text arg 2 is set:
  613. if integer arg 1 is not set:
  614. if {lucky.player.%uuid of player%.playing} is "NotInGame":
  615. if {lucky.arena.%text arg 2%.created} is true:
  616. if {lucky.arena.%text arg 2%.saved} is false:
  617. if {lucky.arena.%text arg 2%.max} is set:
  618. if {lucky.arena.%text arg 2%.min} is set:
  619. if {lucky.arena.%text arg 2%.lobby} is set:
  620. if {lucky.arena.%text arg 2%.spawn.id} = {lucky.arena.%text arg 2%.max}:
  621. if {lucky.arena.%text arg 2%.dm.id} = {lucky.arena.%text arg 2%.max}:
  622. send "&7Saving the arena this will take a while..."
  623. wait 10 ticks
  624. send "&c&lSETUP &e&l» &7The arena &a%text arg 2%&7 has been saved!"
  625. add text arg 2 to {lucky.arenas::*}
  626. set {lucky.arena.%text arg 2%.saved} to true
  627. set {lucky.arena.%text arg 2%.status} to "{@restarting}"
  628. make player execute command "//expand vert"
  629. make player execute command "rb addregion %arg-2%"
  630. clear player's inventory
  631. clear {lucky.arena.%uuid of player%.creating}
  632. wait 1 second
  633. lucky_resetarena(arg-2)
  634. stop
  635. else:
  636. send "&cDeathmatch spawns need to be same count as spawns!"
  637. stop
  638. else:
  639. send "&cYou not set spawns correctly!"
  640. stop
  641. else:
  642. send "&cYou need to set the arena lobby!"
  643. stop
  644. else:
  645. send "&cYou need to set the minimum players!"
  646. stop
  647. else:
  648. send "&cYou need to set the maximum players!"
  649. stop
  650. else:
  651. send "&cYou have already saved this arena!"
  652. stop
  653. else:
  654. send "&cThis arena doesn't even exists!"
  655. stop
  656. else:
  657. send "&cYou can't do this while playing!"
  658. stop
  659. else:
  660. send "&cYou don't need to specify a number!"
  661. stop
  662. else:
  663. send "&cYou must specify an arena name!"
  664. stop
  665. else:
  666. send "&cYou don't have permission to execute this command!"
  667. stop
  668. if text arg 1 is "max":
  669. if player have permission "lucky.admin":
  670. if text arg 2 is set:
  671. if integer arg 1 is set:
  672. if {lucky.player.%uuid of player%.playing} is "NotInGame":
  673. if {lucky.arena.%text arg 2%.created} is true:
  674. if {lucky.arena.%text arg 2%.saved} is false:
  675. if integer arg 1 > 0:
  676. set {lucky.arena.%text arg 2%.max} to integer arg 1
  677. send "&c&lSETUP &e&l» &7Setted the &amaximum players &7to &a%integer arg 1%&7!"
  678. play sound "LEVEL_UP" to player with volume 100.0 and pitch 100.0
  679. stop
  680. else:
  681. send "&cYou can't use negative number!"
  682. stop
  683. else:
  684. send "&cThis arena is saved! That means that it is not open to any kind of modifications."
  685. stop
  686. else:
  687. send "&cThis arena doesn't even exists!"
  688. stop
  689. else:
  690. send "&cYou can't do this while playing!"
  691. stop
  692. else:
  693. send "&cYou must specify a number!"
  694. stop
  695. else:
  696. send "&cYou must specify an arena name!"
  697. stop
  698. else:
  699. send "&cYou don't have permission to execute this command!"
  700. stop
  701. if text arg 1 is "min":
  702. if player have permission "lucky.admin":
  703. if text arg 2 is set:
  704. if integer arg 1 is set:
  705. if {lucky.player.%uuid of player%.playing} is "NotInGame":
  706. if {lucky.arena.%text arg 2%.created} is true:
  707. if {lucky.arena.%text arg 2%.saved} is false:
  708. if integer arg 1 > 0:
  709. set {lucky.arena.%text arg 2%.min} to integer arg 1
  710. send "&c&lSETUP &e&l» &7Setted the &aminimum players &7to &a%integer arg 1%&7!"
  711. play sound "LEVEL_UP" to player with volume 100.0 and pitch 100.0
  712. stop
  713. else:
  714. send "&cYou can't use negative number!"
  715. stop
  716. else:
  717. send "&cThis arena is saved! That means that it is not open to any kind of modifications."
  718. stop
  719. else:
  720. send "&cThis arena doesn't even exists!"
  721. stop
  722. else:
  723. send "&cYou can't do this while playing!"
  724. stop
  725. else:
  726. send "&cYou must specify a number!"
  727. stop
  728. else:
  729. send "&cYou must specify an arena name!"
  730. stop
  731. else:
  732. send "&cYou don't have permission to execute this command!"
  733. stop
  734. if text arg 1 is "stats":
  735. if player have permission "lucky.player":
  736. if arg-2 is not set:
  737. send "&8&l●&7&l&m----------------------&8&l●"
  738. send ""
  739. send "&3&l» &7&lKILLS &c%{lucky.stats.kills.%uuid of player%}%"
  740. send "&3&l» &7&lDEATHS &c%{lucky.stats.deaths.%uuid of player%}%"
  741. send "&3&l» &7&lWINS &c%{lucky.stats.wins.%uuid of player%}%"
  742. send "&3&l» &7&lCOINS &c%{lucky.stats.coins.%uuid of player%}%"
  743. send ""
  744. send "&8&l●&7&l&m----------------------&8&l●"
  745. if arg-2 is set:
  746. set {_uuid} to uuid of arg-2 parsed as player
  747. if {lucky.stats.kills.%{_uuid}%} is set:
  748. send "&8&l●&7&l&m----------------------&8&l●"
  749. send ""
  750. send "&3&l» &7&lKILLS &c%{lucky.stats.kills.%{_uuid}%}%"
  751. send "&3&l» &7&lDEATHS &c%{lucky.stats.deaths.%{_uuid}%}%"
  752. send "&3&l» &7&lWINS &c%{lucky.stats.wins.%{_uuid}%}%"
  753. send "&3&l» &7&lCOINS &c%{lucky.stats.coins.%{_uuid}%}%"
  754. send ""
  755. send "&8&l●&7&l&m----------------------&8&l●"
  756. else:
  757. send "&3&l» &7No data found for &c%arg-2%"
  758.  
  759. else:
  760. send "&cYou don't have permission to execute this command!"
  761. stop
  762. if arg-1 is "resetstats":
  763. if player have permission "lucky.admin":
  764. if arg-2 is set:
  765. set {_player} to arg-2 parsed as player
  766. set {_uuid} to uuid of {_player}
  767. set {lucky.stats.kills.%{_uuid}%} to 0
  768. set {lucky.stats.deaths.%{_uuid}%} to 0
  769. set {lucky.stats.wins.%{_uuid}%} to 0
  770. set {lucky.stats.coins.%{_uuid}%} to 0
  771. send "&3&l» &c&lYou reset &c&l%arg-2%&c&l's stats"
  772. else:
  773. send "&3&l» &c&l/lucky resetstats <player>"
  774. else:
  775. send "&cYou don't have permission to execute this command!"
  776. stop
  777. if arg-1 is "setfallpoint":
  778. if player have permission "lucky.admin":
  779. if arg-2 is set:
  780. set {lucky.arena.%text arg 2%.fallpoint} to y-coords of player
  781. send "&c&lSETUP &e&l» &7Setted the arena Fall Point"
  782. play sound "LEVEL_UP" to player with volume 100.0 and pitch 100.0
  783. else:
  784. send "&cYou must specify an arena name!"
  785. stop
  786. else:
  787. send "&cYou don't have permission to execute this command!"
  788. stop
  789. if text arg 1 is "coins":
  790. if text arg 2 is set:
  791. if player have permission "lucky.admin":
  792. if integer arg 1 is set:
  793. if player arg 1 is set:
  794. if player arg 1 is online:
  795. if text arg 2 is "give":
  796. if integer arg 1 >= 1:
  797. add integer arg 1 to {lucky.stats.coins.%uuid of player%}
  798. send "{@prefix} &7Gived &a%integer arg 1% &7coins to &a%player arg 1%&7!"
  799. stop
  800. else:
  801. send "&cYou can't use this value!"
  802. stop
  803. if text arg 2 is "take":
  804. if integer arg 1 >= 1:
  805. remove integer arg 1 from {lucky.stats.coins.%uuid of player%}
  806. send "{@prefix} &7Taked &a%integer arg 1% &7coins from &a%player arg 1%&7!"
  807. stop
  808. else:
  809. send "&cYou can't use this value!"
  810. stop
  811. if text arg 2 is "set":
  812. if integer arg 1 >= 0:
  813. set {lucky.stats.coins.%uuid of player%} to integer arg 1
  814. send "{@prefix} &7Setted &a%player arg 1%&a's &7coins to &a%integer arg 1%&7!"
  815. stop
  816. else:
  817. send "&cYou can't use a negative value!"
  818. stop
  819. else:
  820. send "&cYou can only do give, take or set!"
  821. stop
  822. else:
  823. send "&cThis player is not online!"
  824. stop
  825. else:
  826. send "&cYou must specify a player!"
  827. stop
  828. else:
  829. send "&cYou must specify a value!"
  830. stop
  831. else:
  832. send "&cYou don't have permission to execute this command!"
  833. stop
  834. else:
  835. send "{@prefix} &7You have &a%{lucky.stats.coins.%uuid of player%}% &7coins in total!"
  836. stop
  837. if text arg 1 is "leave":
  838. if {lucky.player.%uuid of player%.playing} is "InGame":
  839. if {lucky.player.%uuid of player%.arena} is set:
  840. invoke "lucky.clearplayer" from player
  841. teleport player to {lucky.lobby}
  842. remove player from {lucky.arena.%{lucky.player.%uuid of player%.arena}%.players.alive::*} and {lucky.arena.%{lucky.player.%uuid of player%.arena}%.players.death::*}
  843. remove 1 from {lucky.arena.%{lucky.player.%uuid of player%.arena}%.playing}
  844. reveal player from all players
  845. reveal all players to player
  846. set {lucky.player.%uuid of player%.playing} to "NotInGame"
  847. if {lucky.arena.%{lucky.player.%uuid of player%.arena}%.status} is "{@ingame}" or "{@deathmatch}":
  848. if {lucky.arena.%{lucky.player.%uuid of player%.arena}%.playing} is 1:
  849. loop {lucky.arena.%{lucky.player.%uuid of player%.arena}%.players.alive::*}:
  850. invoke "lucky.winner" from loop-value
  851. else:
  852. remove player from {lucky.arena.%{lucky.player.%uuid of player%.arena}%.players.alive::*} and {lucky.arena.%{lucky.player.%uuid of player%.arena}%.players.death::*}
  853. send "{@leftmessage} &7(%{lucky.arena.%{lucky.player.%uuid of player%.arena}%.playing}%&7/%{lucky.arena.%{lucky.player.%uuid of player%.arena}%.max}%&7)" to {lucky.arena.%{lucky.player.%uuid of player%.arena}%.players.alive::*} and {lucky.arena.%{lucky.player.%uuid of player%.arena}%.players.death::*}
  854. invoke "lucky.clearplayer" from player
  855. teleport {_p} to {lucky.lobby}
  856. reveal player to all players
  857. stop
  858. if {lucky.arena.%{lucky.player.%uuid of player%.arena}%.status} is "{@starting}" or "{@full}":
  859. set {lucky.arena.%{lucky.player.%uuid of player%.arena}%.status} to "{@starting}"
  860. if {lucky.arena.%{lucky.player.%uuid of player%.arena}%.playing} = 0:
  861. set {lucky.arena.%{lucky.player.%uuid of player%.arena}%.status} to "{@waiting}"
  862.  
  863. else:
  864. if {lucky.player.%uuid of player%.playing} is "InGameSPEC":
  865. stop
  866. else:
  867. send "{@leftmessage} &7(%{lucky.arena.%{lucky.player.%uuid of player%.arena}%.playing}%&7/%{lucky.arena.%{lucky.player.%uuid of player%.arena}%.max}%&7)" to {lucky.arena.%{lucky.player.%uuid of player%.arena}%.players.alive::*} and {lucky.arena.%{lucky.player.%uuid of player%.arena}%.players.death::*}
  868. else:
  869. send "{@prefix} &cError founded!"
  870. send "&8&l● &3Error 5.0.2 RasenShuriken"
  871. stop
  872. else:
  873. send "&cYou are not playing in any arena!"
  874. stop
  875.  
  876.  
  877.  
  878. #
  879. # \\ CHAT //
  880. #
  881.  
  882. on chat:
  883. if {lucky.player.%uuid of player%.playing} is "InGame" or "InGameSPEC":
  884. cancel event
  885. set {_coins} to {lucky.stats.coins.%uuid of player%}
  886. if {lucky.player.%uuid of player%.playing} is "InGameSPEC":
  887. send {@specchat} to {lucky.arena.%{lucky.player.%uuid of player%.arena}%.players.death::*}
  888.  
  889. if {lucky.player.%uuid of player%.playing} is "InGame":
  890. send {@normalchat} to {lucky.arena.%{lucky.player.%uuid of player%.arena}%.players.alive::*} and {lucky.arena.%{lucky.player.%uuid of player%.arena}%.players.death::*}
  891.  
  892.  
  893. #
  894. # \\ IN-GAME COMMANDS //
  895. #
  896.  
  897. on command:
  898. if {@onlyingamecommands} is true:
  899. if {lucky.player.%uuid of player%.playing} is "InGame" or "InGameSPEC":
  900. if command is {@ingamecommands}:
  901. stop
  902. if player is op:
  903. stop
  904. if player has permission "lucky.admin":
  905. stop
  906. else:
  907. cancel event
  908. send "{@prefix} You can't use this command in game!"
  909.  
  910.  
  911. #
  912. # \\ SIGNS //
  913. #
  914. on sign change:
  915. if line 1 is "[Lucky]" or "[LuckyRace]":
  916. if line 2 is set:
  917. if line 2 is "autojoin":
  918. set line 1 to "{@signline1}"
  919. set line 2 to "{@autojoinline}"
  920. send "{@prefix} &7Sign Added"
  921. stop
  922. if line 2 is "arenas":
  923. set line 1 to "{@signline1}"
  924. set line 2 to "{@menuline}"
  925. send "{@prefix} &7Sign Added"
  926. stop
  927.  
  928.  
  929.  
  930.  
  931. on right-click on sign:
  932. if line 1 is "{@signline1}":
  933. if line 2 is "{@autojoinline}":
  934. make player execute the command "/lucky autojoin"
  935. stop
  936. if line 2 is "{@menuline}":
  937. make player execute the command "/lucky list"
  938. stop
  939. else:
  940. stop
  941.  
  942.  
  943. on break:
  944. if {lucky.player.%uuid of player%.playing} is "InGame" or "InGameSPEC":
  945. if event-block is not sponge:
  946. cancel event
  947. if {lucky.player.%uuid of player%.playing} is "InGameSPEC":
  948. cancel event
  949.  
  950. on break of sponge:
  951. if {lucky.player.%uuid of player%.playing} is "InGame":
  952. if {@useluckyblockplugin} is false:
  953. cancel event
  954. set event-block to air
  955. set {_x} to random element out of {LUCKY.BLOCKS::*}
  956. drop {_x} at location of event-block
  957. show mob spawner flames at the event-block
  958.  
  959. on place:
  960. if {lucky.player.%uuid of player%.playing} is "InGame" or "InGameSPEC":
  961. cancel event
  962. if {lucky.arena.%uuid of player%.creating} is set:
  963. if name of item is "&7SET LOWBOUND &cAND &7SET HIGHBOUND" or "&7ADD SPAWN &aAND &7REMOVE SPAWN" or "&7ADD &cDM SPAWN &aAND &7REMOVE &cDM &7SPAWN" or "&7SET ARENA &cLOBBY" or "&7SET &cMIN PLAYERS" or "&7SET &cMAX PLAYERS" or "&c&lSAVE ARENA" or "&7ARENA &c%{lucky.arena.%uuid of player%.creating}%" or "&7SET ARENA &cFALL POINT":
  964. cancel event
  965. else:
  966. stop
  967. else:
  968. stop
  969.  
  970.  
  971. on hunger bar change:
  972. if {lucky.player.%uuid of player%.playing} is set:
  973. set player's hunger to 20
  974.  
  975.  
  976. function spec(s: player,p: player):
  977. set {_suuid} to uuid of {_s}
  978. set {_puuid} to uuid of {_p}
  979. if {lucky.player.%{_puuid}%.arena} = {lucky.player.%{_suuid}%.arena}:
  980. teleport {_s} to {_p}
  981.  
  982. on pickup:
  983. if {lucky.player.%uuid of player%.playing} is "InGameSPEC":
  984. cancel event
  985.  
  986.  
  987. on drop:
  988. if {lucky.player.%uuid of player%.playing} is "InGame":
  989. if {lucky.arena.%{lucky.player.%uuid of player%.arena}%.status} is "{@waiting}" or "{@starting}" or "{@full}":
  990. cancel event
  991. else:
  992. if event-item is crafting table named "&aCrafting Table":
  993. cancel event
  994. if {lucky.player.%uuid of player%.playing} is "InGameSPEC":
  995. cancel event
  996.  
  997.  
  998.  
  999. on right click:
  1000. if {lucky.player.%uuid of player%.playing} is "InGame" or "InGameSPEC":
  1001. if event-item is crafting table:
  1002. open crafting table to player
  1003. if name of item is "{@teleporteritemname}":
  1004. set {_lucky.spec} to 0
  1005. open virtual chest inventory with size 6 named "{@specgui}" to player
  1006. loop {lucky.arena.%{lucky.player.%uuid of player%.arena}%.players.alive::*}:
  1007. wait 1 tick
  1008. set {_p} to loop-value
  1009. make a gui slot {_lucky.spec} of player with loop-value's skull named "%{_p}'s displayname%" with lore "||&3&l» &e&l● &7&lClick To Teleport||" to run function spec(player,loop-value)
  1010. add 1 to {_lucky.spec}
  1011. set {_lucky.spec} to 0
  1012. stop
  1013. if name of item is "{@leaveitemname}":
  1014. make player execute command "lucky leave"
  1015. stop
  1016. if {lucky.arena.%uuid of player%.creating} is set:
  1017.  
  1018. if name of item is "&7SET LOWBOUND &cAND &7SET HIGHBOUND":
  1019. cancel event
  1020. make player execute command "//pos1"
  1021.  
  1022. if name of item is "&7ADD SPAWN &aAND &7REMOVE SPAWN":
  1023. cancel event
  1024. make player execute command "lucky addspawn %{lucky.arena.%uuid of player%.creating}%"
  1025.  
  1026. if name of item is "&7ADD &cDM SPAWN &aAND &7REMOVE &cDM &7SPAWN":
  1027. cancel event
  1028. make player execute command "lucky adddmSpawn %{lucky.arena.%uuid of player%.creating}%"
  1029.  
  1030. if name of item is "&7SET ARENA &cLOBBY":
  1031. cancel event
  1032. make player execute command "lucky setarenalobby %{lucky.arena.%uuid of player%.creating}%"
  1033.  
  1034. if name of item is "&7SET ARENA &cFALL POINT":
  1035. cancel event
  1036. make player execute command "lucky setfallpoint %{lucky.arena.%uuid of player%.creating}%"
  1037.  
  1038. if name of item is "&7SET &cMIN PLAYERS":
  1039. open virtual chest inventory with size 6 named "&cSET MIN" to player
  1040. wait 3 ticks
  1041. set {_lucky.setplayers} to -1
  1042. loop 55 times:
  1043. make a gui slot {_lucky.setplayers} of player with clay ball named "&7&l%loop-value%" with lore "||&8&l● &7&lClick to Set!||" to run player command "lucky min %{lucky.arena.%uuid of player%.creating}% %loop-value%"
  1044. add 1 to {_lucky.setplayers}
  1045. set {_lucky.setplayers} to 0
  1046. stop
  1047.  
  1048. if name of item is "&7SET &cMAX PLAYERS":
  1049. open virtual chest inventory with size 6 named "&cSET MAX" to player
  1050. wait 3 ticks
  1051. set {_lucky.setplayers} to -1
  1052. loop 55 times:
  1053. make a gui slot {_lucky.setplayers} of player with clay ball named "&7&l%loop-value%" with lore "||&8&l● &7&lClick to Set!||" to run player command "lucky max %{lucky.arena.%uuid of player%.creating}% %loop-value%"
  1054. add 1 to {_lucky.setplayers}
  1055. set {_lucky.setplayers} to 0
  1056. stop
  1057.  
  1058.  
  1059. if name of item is "&c&lSAVE ARENA":
  1060. cancel event
  1061. make player execute command "lucky saveArena %{lucky.arena.%uuid of player%.creating}%"
  1062. if name of item is "&c&l» &7&lARENA &c&l%{lucky.arena.%uuid of player%.creating}%":
  1063. cancel event
  1064.  
  1065. on left click:
  1066. if name of item is "&7ADD SPAWN &aAND &7REMOVE SPAWN":
  1067. cancel event
  1068. make player execute command "lucky removespawn %{lucky.arena.%uuid of player%.creating}%"
  1069.  
  1070. if name of item is "&7SET LOWBOUND &cAND &7SET HIGHBOUND":
  1071. cancel event
  1072. make player execute command "//pos2"
  1073.  
  1074. if name of item is "&7ADD &cDM SPAWN &aAND &7REMOVE &cDM &7SPAWN":
  1075. cancel event
  1076. make player execute command "lucky removedmSpawn %{lucky.arena.%uuid of player%.creating}%"
  1077.  
  1078. on pressure plate:
  1079. if {lucky.player.%uuid of player%.playing} is "InGame":
  1080. if {lucky.arena.%{lucky.player.%uuid of player%.arena}%.status} is "{@ingame}":
  1081. cancel event
  1082. if block below event-block is redstone block:
  1083. invoke "lucky.finish" from player
  1084. set block at event-location to air
  1085. else:
  1086. set block at event-location to air
  1087. set {lucky.arena.%{lucky.player.%uuid of player%.arena}%.respawnpoint::%uuid of player%} to location of player
  1088. play sound "LEVEL_UP" to player with volume 100.0 and pitch 100.0
  1089. add 1 to {lucky.checkpoints.%{lucky.player.%uuid of player%.arena}%::%player%}
  1090. send "{@prefix} {@checkpoint}"
  1091. create an animated ball effect at location of event-block with id "%uuid of player%" with particle redstone
  1092. wait 0.7 seconds
  1093. delete effect "%uuid of player%"
  1094.  
  1095.  
  1096.  
  1097. on right click on chest:
  1098. if {lucky.player.%uuid of player%.playing} is "InGame":
  1099. if {lucky.arena.%{lucky.player.%uuid of player%.arena}%.status} is "{@ingame}" or "{@deathmatch}":
  1100. if {lucky.arena.%{lucky.player.%uuid of player%.arena}%.CHEST::%location of event-block%} is not set:
  1101. set {lucky.arena.%{lucky.player.%uuid of player%.arena}%.CHEST::%location of event-block%} to true
  1102. clear inventory of event-block
  1103. loop 15 times:
  1104. set {_random} to a random element of {LUCKY.CHESTS::*}
  1105. set {_slot} to a random integer between 0 and 26
  1106. add {_random} to slot {_slot} of block at event-block
  1107.  
  1108.  
  1109. #
  1110. # \\ DEATH EVENT //
  1111. #
  1112.  
  1113. on damage of player:
  1114. if {lucky.player.%uuid of victim%.playing} is "InGame":
  1115. if {lucky.arena.%{lucky.player.%uuid of victim%.arena}%.status} is "{@restarting}" or "{@starting}" or "{@waiting}" or "{@full}":
  1116. cancel event
  1117. if {lucky.arena.%{lucky.player.%uuid of victim%.arena}%.status} is "{@ingame}":
  1118. if damage cause is fall:
  1119. cancel event
  1120. if damage cause is void:
  1121. cancel event
  1122. teleport victim to {lucky.arena.%{lucky.player.%uuid of victim%.arena}%.respawnpoint::%uuid of victim%}
  1123. heal victim
  1124. else:
  1125. if {lucky.arena.%{lucky.player.%uuid of victim%.arena}%.status} is "{@ingame}" or "{@deathmatch}":
  1126. if damage is greater than or equal to health of victim:
  1127. cancel event
  1128. remove 1 from {lucky.lives.%{lucky.player.%uuid of victim%.arena}%::%uuid of victim%}
  1129. create an animated ball effect at location of victim with id "%uuid of victim%" with particle flame
  1130. play sound "LEVEL_UP" to attacker with volume 100.0 and pitch 100.0
  1131. play sound "ANVIL_BREAK" to victim with volume 100.0 and pitch 100.0
  1132. add 1 to {lucky.gamekills.%{lucky.player.%uuid of attacker%.arena}%::%attacker%}
  1133. add 1 to {lucky.stats.kills.%uuid of attacker%}
  1134. add 1 to {lucky.stats.deaths.%uuid of victim%}
  1135. add {@coinsperkill} to {lucky.stats.coins.%uuid of attacker%}
  1136. if {lucky.lives.%{lucky.player.%uuid of victim%.arena}%::%uuid of victim%} = 0:
  1137. set {_victim} to victim
  1138. drop all items in victim's inventory at block 1 above victim
  1139. clear victim's inventory
  1140. invoke "lucky.spec" from {_victim}
  1141. set {lucky.player.%uuid of victim%.playing} to "InGameSPEC"
  1142. remove {_victim} from {lucky.arena.%{lucky.player.%uuid of victim%.arena}%.players.alive::*}
  1143. remove 1 from {lucky.arena.%{lucky.player.%uuid of victim%.arena}%.playing}
  1144. add {_victim} to {lucky.arena.%{lucky.player.%uuid of victim%.arena}%.players.death::*}
  1145. send victim title "{@deathtitle}" with subtitle "{@deathsubtitle}" for 4 seconds
  1146. set {_players.total::*} to {lucky.arena.%{lucky.player.%uuid of victim%.arena}%.players.alive::*} and {lucky.arena.%{lucky.player.%uuid of victim%.arena}%.players.death::*}
  1147. set {_alive} to size of {lucky.arena.%{lucky.player.%uuid of victim%.arena}%.players.alive::*}
  1148. set {_spec} to size of {lucky.arena.%{lucky.player.%uuid of victim%.arena}%.players.death::*}
  1149. if {lucky.arena.%{lucky.player.%uuid of victim%.arena}%.playing} is 1:
  1150. if attacker is set:
  1151. if attacker is player:
  1152. invoke "lucky.winner" from attacker
  1153. else:
  1154. loop {lucky.arena.%{lucky.player.%uuid of victim%.arena}%.players.alive::*}:
  1155. invoke "lucky.winner" from loop-value-1
  1156. else:
  1157. loop {lucky.arena.%{lucky.player.%uuid of victim%.arena}%.players.alive::*}:
  1158. invoke "lucky.winner" from loop-value-1
  1159. else:
  1160. set {_spawn} to random integer between 1 and {lucky.arena.%{lucky.player.%uuid of victim%.arena}%.max}
  1161. heal victim
  1162. teleport victim to {lucky.arena.%{lucky.player.%uuid of victim%.arena}%.dm.%{_spawn}%}
  1163.  
  1164. send "{@prefix} {@deathmessage}" to {_players.total::*}
  1165. wait 0.7 seconds
  1166. delete effect "%uuid of victim%"
  1167.  
  1168. else:
  1169. stop
  1170.  
  1171.  
  1172.  
  1173. on quit:
  1174. make player execute command "lucky leave"
  1175. if {lucky.gamekills.%{lucky.player.%uuid of player%.arena}%::%player%} is set:
  1176. delete {lucky.gamekills.%{lucky.player.%uuid of player%.arena}%::%player%}
  1177. if {lucky.player.%uuid of player%.arena} is set:
  1178. clear {lucky.player.%uuid of player%.arena}
  1179. if {lucky.arena.%uuid of player%.creating} is set:
  1180. delete {lucky.arena.%uuid of player%.creating}
  1181. stop
  1182.  
  1183.  
  1184. every second:
  1185. loop all players:
  1186. if {lucky.player.%uuid of loop-player%.playing} is "InGame" or "InGameSPEC":
  1187. if {lucky.arena.%{lucky.player.%uuid of loop-player%.arena}%.status} is "{@ingame}":
  1188. if stylish scoreboard "LUCKYGAME-%loop-player%" does not exist:
  1189. create new stylish scoreboard named "LUCKYGAME-%loop-player%"
  1190. loop 15 times:
  1191. create a new id based score "LUCKYGAME-%loop-player%Slot%loop-number%" with text "&%loop-number%" slot loop-number for stylish scoreboard "LUCKYGAME-%loop-player%"
  1192. wait 3 ticks
  1193. set title of stylish scoreboard "LUCKYGAME-%loop-player%" to "&6&lLUCKY RACE"
  1194. set stylish scoreboard of loop-player to "LUCKYGAME-%loop-player%"
  1195. set the text of id "LUCKYGAME-%loop-player%Slot15" to "&7%now%"
  1196. set the text of id "LUCKYGAME-%loop-player%Slot14" to "&8&l&m---------------"
  1197. set the text of id "LUCKYGAME-%loop-player%Slot13" to "&8&l● &6TIME LEFT"
  1198. set the text of id "LUCKYGAME-%loop-player%Slot12" to "&8&l● &c&l%{lucky.arena.%{lucky.player.%uuid of loop-player%.arena}%.gametime::minutes}%:%{lucky.arena.%{lucky.player.%uuid of loop-player%.arena}%.gametime::timefix}%%{lucky.arena.%{lucky.player.%uuid of loop-player%.arena}%.gametime::seconds}%"
  1199. set the text of id "LUCKYGAME-%loop-player%Slot11" to "&1&e&9"
  1200. set the text of id "LUCKYGAME-%loop-player%Slot10" to "&7&l» &e&lMap"
  1201. set the text of id "LUCKYGAME-%loop-player%Slot9" to "&3&8&l● &6&l%{lucky.player.%uuid of loop-player%.arena}%"
  1202. set the text of id "LUCKYGAME-%loop-player%Slot8" to "&3&4"
  1203. set the text of id "LUCKYGAME-%loop-player%Slot7" to "&7&l» &e&lCheckpoints"
  1204. set the text of id "LUCKYGAME-%loop-player%Slot6" to "&4&8&l● &6&l%{lucky.checkpoints.%{lucky.player.%uuid of loop-player%.arena}%::%loop-player%}%"
  1205. set the text of id "LUCKYGAME-%loop-player%Slot5" to "&1&4"
  1206. set the text of id "LUCKYGAME-%loop-player%Slot4" to "&7&l» &e&lPLAYERS"
  1207. set the text of id "LUCKYGAME-%loop-player%Slot3" to "&2&8&l● &6&lInGame: %size of {lucky.arena.%{lucky.player.%uuid of loop-player%.arena}%.players.alive::*}%"
  1208. set the text of id "LUCKYGAME-%loop-player%Slot2" to "&8&m&l---------------"
  1209. set the text of id "LUCKYGAME-%loop-player%Slot1" to "{@websitename}"
  1210. if {lucky.arena.%{lucky.player.%uuid of loop-player%.arena}%.status} is "{@deathmatch}" or "{@restarting}":
  1211. if stylish scoreboard "LUCKYDM-%loop-player%" does not exist:
  1212. create new stylish scoreboard named "LUCKYDM-%loop-player%"
  1213. loop 12 times:
  1214. create a new id based score "LUCKYDM-%loop-player%Slot%loop-number%" with text "&%loop-number%" slot loop-number for stylish scoreboard "LUCKYDM-%loop-player%"
  1215. wait 3 ticks
  1216. set title of stylish scoreboard "LUCKYDM-%loop-player%" to "&6&lLUCKY RACE"
  1217. set stylish scoreboard of loop-player to "LUCKYDM-%loop-player%"
  1218. set the text of id "LUCKYDM-%loop-player%Slot12" to "&7%now%"
  1219. set the text of id "LUCKYDM-%loop-player%Slot11" to "&8&l&m---------------"
  1220. set the text of id "LUCKYDM-%loop-player%Slot10" to "&8&l● &6TIME LEFT"
  1221. set the text of id "LUCKYDM-%loop-player%Slot9" to "&8&l● &c&l%{lucky.arena.%{lucky.player.%uuid of loop-player%.arena}%.gametime::minutes}%:%{lucky.arena.%{lucky.player.%uuid of loop-player%.arena}%.gametime::seconds}%"
  1222. set the text of id "LUCKYDM-%loop-player%Slot8" to "&1&e&9"
  1223. set the text of id "LUCKYDM-%loop-player%Slot7" to "&7&l» &c❤ &6&lLEFT"
  1224. set the text of id "LUCKYDM-%loop-player%Slot6" to "&3&8&l● &6&l%{lucky.lives.%{lucky.player.%uuid of loop-player%.arena}%::%uuid of loop-player%}%"
  1225. set the text of id "LUCKYDM-%loop-player%Slot5" to "&3&4"
  1226. set the text of id "LUCKYDM-%loop-player%Slot4" to "&7&l» &e&lPLAYERS"
  1227. set the text of id "LUCKYDM-%loop-player%Slot3" to "&2&8&l● &6&lInGame: %size of {lucky.arena.%{lucky.player.%uuid of loop-player%.arena}%.players.alive::*}%"
  1228. set the text of id "LUCKYDM-%loop-player%Slot2" to "&8&m&l---------------"
  1229. set the text of id "LUCKYDM-%loop-player%Slot1" to "{@websitename}"
  1230. if {lucky.arena.%{lucky.player.%uuid of loop-player%.arena}%.status} is "{@waiting}" or "{@starting}" or "{@full}":
  1231. if stylish scoreboard "LUCKYLOBBY-%loop-player%" does not exist:
  1232. create new stylish scoreboard named "LUCKYLOBBY-%loop-player%"
  1233. loop 12 times:
  1234. create a new id based score "LUCKYLOBBY-%loop-player%Slot%loop-number%" with text "&%loop-number%" slot loop-number for stylish scoreboard "LUCKYLOBBY-%loop-player%"
  1235. wait 3 ticks
  1236. set title of stylish scoreboard "LUCKYLOBBY-%loop-player%" to "&6&lLUCKY RACE"
  1237. set stylish scoreboard of loop-player to "LUCKYLOBBY-%loop-player%"
  1238. set the text of id "LUCKYLOBBY-%loop-player%Slot12" to "&7%now%"
  1239. set the text of id "LUCKYLOBBY-%loop-player%Slot11" to "&8&l&m---------------"
  1240. set the text of id "LUCKYLOBBY-%loop-player%Slot10" to "&8&l● &6STARTING IN"
  1241. set the text of id "LUCKYLOBBY-%loop-player%Slot9" to "&9&8&l● &e%{lucky.arena.%{lucky.player.%uuid of loop-player%.arena}%.seconds}%"
  1242. set the text of id "LUCKYLOBBY-%loop-player%Slot8" to "&1&e&9"
  1243. set the text of id "LUCKYLOBBY-%loop-player%Slot7" to "&7&l» &e&lMap"
  1244. set the text of id "LUCKYLOBBY-%loop-player%Slot6" to "&1&8&l● &6&l%{lucky.player.%uuid of loop-player%.arena}%"
  1245. set the text of id "LUCKYLOBBY-%loop-player%Slot5" to "&1&4"
  1246. set the text of id "LUCKYLOBBY-%loop-player%Slot4" to "&7&l» &e&lPLAYERS"
  1247. set the text of id "LUCKYLOBBY-%loop-player%Slot3" to "&8&l● &6&lLobby: %size of {lucky.arena.%{lucky.player.%uuid of loop-player%.arena}%.players.alive::*}%"
  1248. set the text of id "LUCKYLOBBY-%loop-player%Slot2" to "&8&m&l---------------"
  1249. set the text of id "LUCKYLOBBY-%loop-player%Slot1" to "{@websitename}"
  1250. else:
  1251. if stylish scoreboard "LUCKYLOBBY-%loop-player%" exist:
  1252. delete stylish scoreboard "LUCKYLOBBY-%loop-player%"
  1253. if stylish scoreboard "LUCKYGAME-%loop-player%" exist:
  1254. delete stylish scoreboard "LUCKYGAME-%loop-player%"
  1255. if stylish scoreboard "LUCKYDM-%loop-player%" exist:
  1256. delete stylish scoreboard "LUCKYDM-%loop-player%"
  1257.  
  1258.  
  1259.  
  1260.  
  1261. sub "lucky.join":
  1262. set {_arena} to parameter 1
  1263. if {lucky.arena.%{_arena}%.playing} = {lucky.arena.%{_arena}%.min}:
  1264. set {lucky.arena.%{_arena}%.status} to "{@starting}"
  1265. if {lucky.arena.%{_arena}%.playing} = {lucky.arena.%{_arena}%.max}:
  1266. set {lucky.arena.%{_arena}%.status} to "{@full}"
  1267. set {_sec} to {lucky.arena.%{_arena}%.seconds}
  1268. send "{@prefix} {@startingin}" to {lucky.arena.%{_arena}%.players.alive::*}
  1269. loop {lucky.arena.%{_arena}%.seconds} times:
  1270. remove 1 from {lucky.arena.%{_arena}%.seconds}
  1271. set {_sec} to {lucky.arena.%{_arena}%.seconds}
  1272. wait 1 seconds
  1273. if {_sec} <= 5:
  1274. if {_sec} is greater than 0:
  1275. send {lucky.arena.%{_arena}%.players.alive::*} title "{@startingtitle}" with subtitle "{@startingsubtitle}" for 0.8 seconds
  1276. send "{@prefix} {@startingin}" to {lucky.arena.%{_arena}%.players.alive::*}
  1277. play sound "LEVEL_UP" to {lucky.arena.%{_arena}%.players.alive::*} with volume 100.0 and pitch 100.0
  1278.  
  1279. if {_sec} <= 0:
  1280. if {lucky.arena.%{_arena}%.playing} >= 2:
  1281. send "{@prefix} {@startmessage}" to {lucky.arena.%{_arena}%.players.alive::*}
  1282. invoke "lucky.gametime" from {_arena}
  1283. set {lucky.arena.%{_arena}%.status} to "{@ingame}"
  1284. set {_spawn} to 0
  1285. loop {lucky.arena.%{_arena}%.players.alive::*}:
  1286. set {_p} to loop-value-2
  1287. set {_uuid} to uuid of {_p}
  1288. add 1 to {_spawn}
  1289. invoke "lucky.clearplayer" from {_p}
  1290. teleport {_p} to {lucky.arena.%{_arena}%.spawn.%{_spawn}%}
  1291. set {lucky.arena.%{_arena}%.respawnpoint::%{_uuid}%} to {lucky.arena.%{_arena}%.spawn.%{_spawn}%}
  1292. set {lucky.checkpoints.%{lucky.player.%{_uuid}%.arena}%::%{_p}%} to 0
  1293. set slot 0 of {_p} to iron_sword
  1294. set slot 1 of {_p} to iron_pickaxe
  1295. set slot 8 of {_p} to crafting table named "&aCrafting Table"
  1296. wait 1 tick
  1297.  
  1298. else:
  1299. set {lucky.arena.%{_arena}%.seconds} to {@waitingtime}
  1300. set {lucky.arena.%{_arena}%.status} to "{@waiting}"
  1301. send "{@prefix} &cThere are not enought players to start!" to {lucky.arena.%{_arena}%.players.alive::*}
  1302. stop
  1303.  
  1304.  
  1305. sub "lucky.gametime":
  1306. set {_arena} to parameter 1
  1307. set {lucky.arena.%{_arena}%.gametime::minutes} to {@gameminutes} -1
  1308. set {lucky.arena.%{_arena}%.gametime::seconds} to 60
  1309. set {lucky.arena.%{_arena}%.gametime::timefix} to ""
  1310.  
  1311. loop {@gameminutes}*60+150 times:
  1312. wait 1 seconds
  1313. if {lucky.arena.%{_arena}%.status} is "{@ingame}" or "{@starting}" or "{@full}":
  1314. remove 1 from {lucky.arena.%{_arena}%.gametime::seconds}
  1315.  
  1316. if {lucky.arena.%{_arena}%.gametime::seconds} is 0:
  1317. set {lucky.arena.%{_arena}%.gametime::timefix} to ""
  1318. set {lucky.arena.%{_arena}%.gametime::seconds} to 59
  1319. subtract 1 from {lucky.arena.%{_arena}%.gametime::minutes}
  1320.  
  1321. if {lucky.arena.%{_arena}%.gametime::seconds} is 9:
  1322. set {lucky.arena.%{_arena}%.gametime::timefix} to "0"
  1323.  
  1324. if {lucky.arena.%{_arena}%.gametime::minutes} = 0:
  1325. if {lucky.arena.%{_arena}%.gametime::seconds} <= 1:
  1326. set {lucky.arena.%{_arena}%.gametime::seconds} to 0
  1327. set {lucky.arena.%{_arena}%.gametime::minutes} to 0
  1328. invoke "lucky.deathmatch" from {_arena}
  1329. stop loop
  1330. stop
  1331. else:
  1332. stop loop
  1333. stop
  1334.  
  1335.  
  1336.  
  1337. sub "lucky.deathmatch":
  1338. set {_arena} to parameter 1
  1339. set {lucky.arena.%{_arena}%.gametime::minutes} to 2
  1340. set {lucky.arena.%{_arena}%.gametime::seconds} to 60
  1341. set {lucky.arena.%{_arena}%.status} to "{@deathmatch}"
  1342.  
  1343. loop {lucky.arena.%{_arena}%.players.alive::*}:
  1344. add 1 to {_spawn}
  1345. teleport loop-value to {lucky.arena.%{_arena}%.dm.%{_spawn}%}
  1346. set {lucky.lives.%{lucky.player.%uuid of loop-value%.arena}%::%uuid of loop-value%} to 3
  1347.  
  1348. loop 200 times:
  1349. wait 1 seconds
  1350. if {lucky.arena.%{_arena}%.status} = "{@deathmatch}":
  1351. remove 1 from {lucky.arena.%{_arena}%.gametime::seconds}
  1352.  
  1353. if {lucky.arena.%{_arena}%.gametime::seconds} = 0:
  1354. set {lucky.arena.%{_arena}%.gametime::timefix} to ""
  1355. set {lucky.arena.%{_arena}%.gametime::seconds} to 59
  1356. subtract 1 from {lucky.arena.%{_arena}%.gametime::minutes}
  1357.  
  1358. if {lucky.arena.%{_arena}%.gametime::seconds} = 9:
  1359. set {lucky.arena.%{_arena}%.gametime::timefix} to "0"
  1360.  
  1361. if {lucky.arena.%{_arena}%.gametime::minutes} = 0:
  1362. if {lucky.arena.%{_arena}%.gametime::seconds} <= 1:
  1363. if {lucky.arena.%{_arena}%.status} is not "{@deathmatch}":
  1364. set {lucky.arena.%{_arena}%.gametime::minutes} to 2
  1365. set {lucky.arena.%{_arena}%.gametime::seconds} to 59
  1366. set {lucky.arena.%{_arena}%.gametime::timefix} to ""
  1367. set {lucky.arena.%{_arena}%.status} to "{@deathmatch}"
  1368. send "{@prefix} {@deathmatchstarted}" to {lucky.arena.%{_arena}%.players.alive::*}
  1369. else:
  1370. invoke "lucky.endgame" from {_arena}
  1371. stop loop
  1372. stop
  1373.  
  1374.  
  1375.  
  1376.  
  1377. else:
  1378. stop loop
  1379. stop
  1380.  
  1381.  
  1382.  
  1383. sub "lucky.endgame":
  1384. set {_arena} to parameter 1
  1385. loop {lucky.arena.%{_arena}%.players.alive::*}:
  1386. loop 10 times:
  1387. wait 1 seconds
  1388. if {lucky.arena.%{_arena}%.status} is "{@deathmatch}":
  1389. set {_p} to loop-value-1
  1390. set {_uuid} to uuid of {_p}
  1391. if {lucky.player.%{_uuid}%.playing} is "InGameSPEC":
  1392. stop
  1393. else:
  1394. strike lightning at location of loop-value-1
  1395. else:
  1396. stop loop
  1397. extinguish loop-value-1
  1398. stop
  1399.  
  1400.  
  1401.  
  1402.  
  1403. sub "lucky.finish":
  1404. set {_p} to parameter 1
  1405. set {_uuid} to uuid of {_p}
  1406. send {_p} title "{@finishtitle}" with subtitle "{@finishsubtitle}" for 5 seconds
  1407. send "{@finishmessage}" to {lucky.arena.%{lucky.player.%{_uuid}%.arena}%.players.alive::*}
  1408. set {lucky.arena.%{lucky.player.%{_uuid}%.arena}%.gametime::minutes} to 0
  1409. set {lucky.arena.%{lucky.player.%{_uuid}%.arena}%.gametime::seconds} to {@shorttimeto}
  1410. add {@reachfinal} to {lucky.stats.coins.%{_uuid}%}
  1411. loop 5 times:
  1412. if {lucky.player.%{_uuid}%.playing} is "InGame":
  1413. launch trailing flickering star coloured purple and red fading to yellow at {_p}'s location timed 1
  1414. wait 10 ticks
  1415. else:
  1416. stop loop
  1417. stop
  1418.  
  1419.  
  1420. sub "lucky.spec":
  1421. set {_p} to parameter 1
  1422. set {_uuid} to uuid of {_p}
  1423. hide {_p} from all players
  1424. invoke "lucky.clearplayer" from {_p}
  1425. set {_p}'s slot 0 to {@teleporteritem} named "{@teleporteritemname}"
  1426. set {_p}'s slot 8 to {@leaveitem} named "{@leaveitemname}"
  1427. set {_p}'s flight mode to true
  1428. wait 1 seconds
  1429. teleport {_p} to random element out of {lucky.arena.%{lucky.player.%{_uuid}%.arena}%.players.alive::*}
  1430. stop
  1431.  
  1432.  
  1433.  
  1434. sub "lucky.refreshmenu":
  1435. loop all players:
  1436. if inventory name of loop-player-1's current inventory is "{@arenasguiname}":
  1437. set {_lucky.list} to 0
  1438. loop {lucky.arenas::*}:
  1439. if {lucky.arena.%loop-value-2%.status} is "{@ingame}" or "{@full}" or "{@restarting}":
  1440. make a gui slot {_lucky.list} of loop-player-1 with red clay named "&8 " with lore "&8&l» &7Name&8: &e&l%loop-value-2%||||&8&l» &7Status&8: %{lucky.arena.%loop-value-2%.status}%||||&8&l» &7Players&8: &7%{lucky.arena.%loop-value-2%.playing}%/%{lucky.arena.%loop-value-2%.max}%||||&8&l● &7&lClick to spectate!" to run loop-player-1 command "lucky join %loop-value-2%"
  1441. add 1 to {_lucky.list}
  1442. else:
  1443. make a gui slot {_lucky.list} of loop-player-1 with green clay named "&8 " with lore "&8&l» &7Name&8: &e&l%loop-value-2%||||&8&l» &7Status&8: %{lucky.arena.%loop-value-2%.status}%||||&8&l» &7Players&8: &7%{lucky.arena.%loop-value-2%.playing}%/%{lucky.arena.%loop-value-2%.max}%||||&8&l● &7&lClick to join!" to run loop-player-1 command "lucky join %loop-value-2%"
  1444. add 1 to {_lucky.list}
  1445. stop
  1446.  
  1447.  
  1448. sub "lucky.clearplayer":
  1449. set {_p} to parameter 1
  1450. milk {_p}
  1451. heal {_p}
  1452. extinguish {_p}
  1453. set {_p}'s food to 20
  1454. clear {_p}'s level
  1455. clear {_p}'s inventory
  1456. close {_p}'s inventory
  1457. set {_p}'s gamemode to survival
  1458. set {_p}'s flight mode to false
  1459.  
  1460. sub "lucky.winner":
  1461. set {_p} to parameter 1
  1462. set {_uuid} to uuid of {_p}
  1463. set {_arena} to {lucky.player.%{_uuid}%.arena}
  1464. set {lucky.arena.%{_arena}%.status} to "{@restarting}"
  1465. invoke "lucky.summary" from {_p} and {lucky.player.%{_uuid}%.arena}
  1466. invoke "lucky.clearplayer" from {_p}
  1467. send {_p} title "{@winnertitle}" with subtitle "{@winnersubtitle}" for 7 seconds
  1468. add 1 to {lucky.stats.wins.%{_uuid}%}
  1469. add {@coinsperwin} to {lucky.stats.coins.%{_uuid}%}
  1470. loop 15 times:
  1471. if {lucky.player.%{_uuid}%.playing} is "InGame":
  1472. launch trailing flickering star coloured purple and red fading to yellow at {_p}'s location timed 1
  1473. wait 10 ticks
  1474. wait {@winlenght} seconds
  1475. set {_players.total::*} to {lucky.arena.%{_arena}%.players.alive::*} and {lucky.arena.%{_arena}%.players.death::*}
  1476. loop {_players.total::*}:
  1477. invoke "lucky.clearplayer" from loop-value
  1478. teleport loop-value to {lucky.lobby}
  1479. set {lucky.player.%uuid of loop-value%.playing} to "NotInGame"
  1480. reveal loop-value from all players
  1481. set {lucky.arena.%{_arena}%.status} to "{@restarting}"
  1482. wait 5 ticks
  1483. lucky_resetarena({_arena})
  1484. stop
  1485.  
  1486.  
  1487.  
  1488.  
  1489. sub "lucky.summary":
  1490. set {_p} to parameter 1
  1491. set {_arena} to parameter 2
  1492. set {_uuid} to uuid of {_p}
  1493. loop {lucky.gamekills.%{_arena}%::*}:
  1494. set {_backup::%loop-index%} to loop-value
  1495. loop 3 times:
  1496. delete {_first.player}
  1497. delete {_first.number}
  1498. loop {_backup::*}:
  1499. if {_first.player} is not set:
  1500. set {_first.number} to loop-value-2
  1501. set {_first.player} to loop-index
  1502. else:
  1503. if loop-value-2 > {_first.number}:
  1504. set {_first.number} to loop-value-2
  1505. set {_first.player} to loop-index
  1506. add {_first.number} to {_list::*}
  1507. add {_first.player} to {_list2::*}
  1508. delete {_backup::%{_first.player}%}
  1509. if {_list::1} is not set:
  1510. set {_list::1} to 0
  1511. if {_list::2} is not set:
  1512. set {_list::2} to 0
  1513. if {_list::3} is not set:
  1514. set {_list::3} to 0
  1515. if {_list2::1} is not set:
  1516. set {_list2::1} to "Nobody"
  1517. if {_list2::2} is not set:
  1518. set {_list2::2} to "Nobody"
  1519. if {_list2::3} is not set:
  1520. set {_list2::3} to "Nobody"
  1521. if {lucky.checkpoints.%{_arena}%::%{_list2::2}%} is not set:
  1522. set {lucky.checkpoints.%{_arena}%::%{_list2::2}%} to 0
  1523. if {lucky.checkpoints.%{_arena}%::%{_list2::3}%} is not set:
  1524. set {lucky.checkpoints.%{_arena}%::%{_list2::3}%} to 0
  1525. set {_players.total::*} to {lucky.arena.%{_arena}%.players.alive::*} and {lucky.arena.%{_arena}%.players.death::*}
  1526. wait 0.1 seconds
  1527. send "&3&l■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ " to {_players.total::*}
  1528. send " " to {_players.total::*}
  1529. send " &8&l● &f&lLucky Race &8&l● " to {_players.total::*}
  1530. send " " to {_players.total::*}
  1531. send " &eWinner &f- &3%{_p}'s displayname% " to {_players.total::*}
  1532. send " " to {_players.total::*}
  1533. send " &c&l» &e&l1st Place &8&l» &3%{_list2::1}%" to {_players.total::*}
  1534. send " &a&l● &6&lKills &8&l┃&7%{_list::1}%&8&l┃ &6&lCheckpoints &8&l┃&7%{lucky.checkpoints.%{_arena}%::%{_list2::1}%}%&8&l┃" to {_players.total::*}
  1535. send " &c&l» &e&l2nd Place &8&l» &7%{_list2::2}%" to {_players.total::*}
  1536. send " &a&l● &6&lKills &8&l┃&7%{_list::2}%&8&l┃ &6&lCheckpoints &8&l┃&7%{lucky.checkpoints.%{_arena}%::%{_list2::2}%}%&8&l┃" to {_players.total::*}
  1537. send " &c&l» &e&l3rd Place &8&l» &7%{_list2::3}%" to {_players.total::*}
  1538. send " &a&l● &6&lKills &8&l┃&7%{_list::3}%&8&l┃ &6&lCheckpoints &8&l┃&7%{lucky.checkpoints.%{_arena}%::%{_list2::3}%}%&8&l┃" to {_players.total::*}
  1539. send " " to {_players.total::*}
  1540. send "&3&l■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ " to {_players.total::*}
  1541.  
  1542.  
  1543.  
  1544.  
  1545.  
  1546. command /settime [<integer>] [<integer>]:
  1547. trigger:
  1548. set {lucky.arena.%{lucky.player.%uuid of player%.arena}%.gametime::minutes} to arg-1
  1549. set {lucky.arena.%{lucky.player.%uuid of player%.arena}%.gametime::seconds} to arg-2
Add Comment
Please, Sign In to add comment