· 6 years ago · Mar 20, 2019, 06:48 AM
1options:
2 plugin-version: 0.1.1-C
3
4
5
6#
7# â— SETTINGS â—
8#
9
10 prefix: &6&lLuckyRace &8&l»&7
11
12 only-in-game-commands: true
13 in-game-commands: "leave" or "lobby" or "hub" or "msg" or "tell" or "w" or "lucky"
14
15
16#Timers
17 waiting-time: 10 #seconds, before game starts
18 game-minutes: 10 #minutes, in game time
19 win-lenght: 8 #seconds, until arena restart after win.
20 short-time-to: 30 #seconds, after first player reach to finish.
21
22#Coins
23
24 coins-per-kill: 5
25 coins-per-win: 100
26 reach-final: 50
27
28
29#Chat
30 normal-chat: "&7%player's displayname% &8&l» &7%message%"
31 spec-chat: "&7%player's displayname% &8&l» &7 %message%"
32
33#Mix
34
35
36# commands
37
38 kill-command: eco give %attacker% 5
39 win-command: eco give %{_p}% 50
40 arena-reset-command: ""
41
42
43 disable-hunger-loss: true
44
45
46
47
48#
49# â— SCOREBOARD â—
50#
51
52 website-name: &e&lMC.SERVER.NET
53
54
55
56#
57# â— SOUNDS â—
58#
59
60 #Sounds List for 1.8 http://docs.codelanx.com/Bukkit/1.8/org/bukkit/Sound.html
61 #Sounds List for 1.9 and greater https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Sound.html
62
63 checkpoint-sound: LEVEL_UP
64 join-sound: LEVEL_UP
65 kill-sound: LEVEL_UP
66 death-sound: ANVIL_BREAK
67
68
69#
70# â— GAME STAGE NAMES â—
71#
72
73 waiting: &a&lLobby
74 ingame: &aInGame
75 starting: &a&lStarting
76 deathmatch: &a&lDeathmatch
77 restarting: &c&lEndGame
78 full: &c&lFULL
79
80
81#
82# â— TITLES â—
83#
84
85 winner-title: &3&lYOU WON!
86 winner-subtitle: &7You are the last man standing!
87 death-title: &4&lYOU LOST...
88 death-subtitle: &7
89 starting-title: &c&l%{_sec}%
90 starting-subtitle: &eBefore game starts!
91 finish-title: &6&lYou finished the race!
92 finish-subtitle: &cWait for the final stage!
93
94
95#
96# â— MESSAGESS â—
97#
98
99
100 starting-in: &7Starting in %{_sec}% &7seconds!
101
102 start-message: &a&lGAME STARTED, GOOD LUCK EVERYONE!
103
104 join-message: &7%{_p}'s displayname% &6Joined
105
106 left-message: &7%{_p}'s displayname% &6has left
107
108 death-message: &c&l» &7%victim's displayname% &ehas been killed by &7%{_attacker}%
109
110 deathmatch-started: &cDEATHMATCH STARTED!
111
112 checkpoint: &e&l» &a&lCheckpoint Reached &9◠&6&l! &e&l«
113
114 finish-message: &e&l» &a&l%{_p}'s displayname% &6&lfinished the race &9◠&6&l! &e&l«
115
116 full-arena-msg: &cThis arena is full.
117
118#
119# â— ITEM NAMES â—
120#
121
122
123 leave-item: magma_cream
124 leave-item-name: &6&lLeave The Game
125
126
127#
128# â— GUIS â—
129#
130
131 arenas-list-name: LUCKY ARENAS
132
133
134on skript load:
135 clear {LUCKY.BLOCKS::*}
136 wait 1 seconds
137
138
139#
140# â— LUCKY BLOCKS LOOT â—
141#
142
143 add 1 iron_sword, 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::*}
144
145
146
147
148
149
150
151
152on join:
153 loop "kills", "wins", "coins" and "deaths":
154 if {lucky.stats.%loop-value%.%uuid of player%} is not set:
155 set {lucky.stats.%loop-value%.%uuid of player%} to 0
156
157
158command /lucky [<text>] [<text>] [<integer>] [<player>]:
159 executable by: players
160 trigger:
161 if arg-1 is not set:
162 make player execute command "lucky help"
163 stop
164 if arg-1 is "help":
165 send "&7&lâ– â– â– â– â– â– â– â– â– &8[ {@prefix} &8]&7&lâ– â– â– â– â– â– â– â– â– "
166 send "&8&l» &7/lucky list "
167 send "&8&l» &7/lucky join &8(&7arena_name&8) "
168 send "&8&l» &7/lucky stats "
169 send "&8&l» &7/lucky autojoin "
170 send "&8&l» &7/lucky leave "
171 send "&7&lâ– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– "
172 if player have permission "lucky.admin":
173 send "&8&l» &c/lucky setlobby "
174 send "&8&l» &c/lucky createArena &8(&7arena_name&8) "
175 send "&8&l» &c/lucky deleteArena &8(&7arena_name&8) "
176 send "&8&l» &c/lucky addSpawn &8(&7arena_name&8) "
177 send "&8&l» &c/lucky removeSpawn &8(&7arena_name&8) "
178 send "&8&l» &c/lucky adddmSpawn &8(&7arena_name&8) "
179 send "&8&l» &c/lucky removedmSpawn &8(&7arena_name&8) "
180 send "&8&l» &c/lucky saveArena &8(&7arena_name&8) "
181 send "&8&l» &c/lucky setarenalobby &8(&7arena_name&8) "
182 send "&8&l» &c/lucky Max &8(&7arena_name&8) &8(&7number&8) "
183 send "&8&l» &c/lucky Min &8(&7arena_name&8) &8(&7number&8) "
184 send "&8&l» &c/lucky coins take/set/give &8(&7player&8) "
185 send "&8&l» &c/lucky resetstats &8(&7player&8) "
186 send "&7&lâ– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– "
187 stop
188 if arg-1 is not "autojoin" or "list" or "setLobby" or "join" or "createArena" or "deleteArena" or "addSpawn" or "removeSpawn" or "saveArena" or "max" or "min" or "resetstats" or "stats" or "leave" or "adddmSpawn" or "removedmSpawn" or "setarenalobby":
189 make player execute the command "lucky"
190 stop
191 if arg-1 is "join":
192 if {lucky.player::%uuid of player%.playing} is not set:
193 if arg-2 is set:
194 if {lucky.arena.%arg-2%.created} is true:
195 if {lucky.arena.%arg-2%.saved} is true:
196 if {lucky.arena.%arg-2%.status} is "{@waiting}" or "{@starting}":
197 lucky_join(player, arg-2)
198 stop
199 if {lucky.arena.%arg-2%.status} is "{@ingame}":
200 send "&cThis arena already started!"
201 stop
202 if {lucky.arena.%arg-2%.status} is "{@restarting}":
203 send "&cThis arena is currently being restarted!"
204 stop
205 else:
206 send "{@prefix} &7Error founded!"
207 send "&8&lâ— &3Error 5.0.2 RasenShuriken"
208 stop
209 else:
210 send "&cThis arena hasn't been saved!"
211 stop
212 else:
213 send "&cThis arena doesn't exists!"
214 stop
215 else:
216 send "&cYou must specify an arena name!"
217 stop
218 else:
219 send "&cYou can't execute this command while playing!"
220 stop
221 if arg-1 is "autojoin":
222 loop {lucky.arenas::*}:
223 if {lucky.arena.%loop-value%.status} is "{@waiting}" or "{@starting}":
224 make player execute the command "/lucky join %loop-value%"
225 stop loop
226 stop
227 if arg-1 is "list":
228 open virtual chest inventory with size 6 named "{@arenas-list-name}" to player
229 wait a tick
230 make a gui slot 0, 1, 2, 3, 4, 5, 6, 7, 17, 26, 35, 44, 18, 27, 36, 9, 45, 46, 47, 48, 49, 50, 51, 52, 53 and 8 of player with green glass named "&8 " to do nothing
231 set {_slot} to 10
232 loop {lucky.arenas::*}:
233 if {lucky.arena.%loop-value%.status} is "{@ingame}" or "{@restarting}":
234 make a gui slot {_slot} 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%size of {lucky.arena.%loop-value%.players.alive::*}%/%{lucky.arena.%loop-value%.max}%||||&8&l◠&7&lClick to spectate!" to run player command "lucky join %loop-value%"
235 else:
236 make a gui slot {_slot} 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%size of {lucky.arena.%loop-value%.players.alive::*}%/%{lucky.arena.%loop-value%.max}%||||&8&l◠&7&lClick to join!" to run player command "lucky join %loop-value%"
237 add 1 to {_slot}
238 if {_slot} is 17 or 26 or 35:
239 add 2 to {_slot}
240 if arg-1 is "setlobby" or "createArena" or "deleteArena" or "adddmSpawn" or "addSpawn" or "removeSpawn" or "removedmSpawn" or "setarenalobby" or "saveArena" or "resetstats" or "min" or "max":
241 if player have permission "lucky.admin":
242 if arg-1 is "setlobby":
243 if {lucky.player::%uuid of player%.playing} is not set:
244 set {lucky.lobby} to the player's location
245 send "&c&lSETUP &e&l» &7Setted the &aLobby &7to your current location!"
246 stop
247 else:
248 send "&cYou can't change the Lobby location while playing!"
249 stop
250 if arg-1 is "createArena":
251 if arg-2 is set:
252 if {lucky.player::%uuid of player%.playing} is not set:
253 if {lucky.arena.%arg-2%.created} is not set:
254 set {lucky.arena.%arg-2%.created} to true
255 set {lucky.arena.%arg-2%.saved} to false
256 set {lucky.arena.%arg-2%.spawn.id} to 0
257 set {lucky.arena.%uuid of player%.creating} to text arg-2
258 clear player's inventory
259 send "&c&lSETUP &e&l» &7The arena &a%arg-2% &7has been successfully created!"
260 set slot 0 of player to yellow clay named "&7ADD SPAWN &aAND &7REMOVE SPAWN"
261 set slot 1 of player to green clay named "&7ADD &cDM SPAWN &aAND &7REMOVE &cDM &7SPAWN"
262 set slot 2 of player to clay ball named "&7SET ARENA &cLOBBY"
263 set slot 4 of player to yellow clay named "&7SET &cMIN PLAYERS"
264 set slot 5 of player to yellow clay named "&7SET &cMAX PLAYERS"
265 set slot 7 of player to green clay named "&7ARENA &c%{lucky.arena.%uuid of player%.creating}%"
266 set slot 8 of player to red clay named "&c&lSAVE ARENA"
267 stop
268 else:
269 send "&cThis arena has already been created!"
270 stop
271 else:
272 send "&cYou can't do this while playing!"
273 stop
274 else:
275 send "&cYou must specify an arena name!"
276 stop
277 if arg-1 is "deleteArena":
278 if arg-2 is set:
279 if {lucky.player::%uuid of player%.playing} is not set:
280 if {lucky.arena.%arg-2%.created} is true:
281 if {lucky.arena.%arg-2%.playing} is 0:
282 delete {lucky.arena.%arg-2%.created}
283 delete {lucky.arena.%arg-2%.saved}
284 delete {lucky.arena.%arg-2%.status}
285 delete {lucky.arena.%arg-2%.max}
286 delete {lucky.arena.%arg-2%.min}
287 delete {lucky.arena.%arg-2%.spawn.id}
288 delete {lucky.arena.%arg-2%.players.alive::*}
289 delete {lucky.arena.%arg-2%.players.death::*}
290 delete {lucky.arena.%arg-2%.created}
291 delete {lucky.arena.%arg-2%.saved}
292 delete {lucky.arena.%arg-2%.lobby}
293 delete {lucky.arena.%arg-2%.gametime::*}
294 delete {lucky.arena.%arg-2%.dm.id}
295 delete {lucky.lives.%arg-2%::*}
296 delete {lucky.checkpoints.%arg-2%::*}
297 delete {lucky.gamekills.%arg-2%::*}
298 delete {lucky.arena.%arg-2%.CHEST::*}
299 remove arg-2 from {lucky.arenas::*}
300 send "&c&lSETUP &e&l» &7The arena &c%arg-2% &7has been successfully deleted!"
301 stop
302 else:
303 send "&cThere are still players playing in the arena!"
304 stop
305 else:
306 send "&cThis arena doesn't even exists!"
307 stop
308 else:
309 send "&cYou can't do this while playing!"
310 stop
311 else:
312 send "&cYou must specify an arena name!"
313 stop
314 if arg-1 is "adddmSpawn":
315 if arg-2 is set:
316 if integer arg 1 is not set:
317 if {lucky.player::%uuid of player%.playing} is not set:
318 if {lucky.arena.%arg-2%.created} is true:
319 add 1 to {lucky.arena.%arg-2%.dm.id}
320 set {lucky.arena.%arg-2%.dm.%{lucky.arena.%arg-2%.dm.id}%} to location of player
321 send "&c&lSETUP &e&l» &7DM,Spawn &anº%{lucky.arena.%arg-2%.dm.id}% &7has been set!"
322 stop
323 else:
324 send "&cThis arena doesn't even exists!"
325 stop
326 else:
327 send "&cYou can't do this while playing!"
328 stop
329 else:
330 send "&cYou don't need to specify a number!"
331 stop
332 else:
333 send "&cYou must specify an arena name!"
334 stop
335 if arg-1 is "removedmSpawn":
336 if arg-2 is set:
337 if integer arg 1 is not set:
338 if {lucky.player::%uuid of player%.playing} is not set:
339 if {lucky.arena.%arg-2%.created} is true:
340 if {lucky.arena.%arg-2%.dm.id} is not 0:
341 send "&c&lSETUP &e&l» &7DM, Spawn &anº%{lucky.arena.%arg-2%.dm.id}% &7has been deleted!"
342 delete {lucky.arena.%arg-2%.dm.%{lucky.arena.%arg-2%.dm.id}%}
343 remove 1 from {lucky.arena.%arg-2%.dm.id}
344 stop
345 else:
346 send "&cThere is no more spawns to remove!"
347 stop
348 else:
349 send "&cThis arena doesn't even exists!"
350 stop
351 else:
352 send "&cYou can't do this while playing!"
353 stop
354 else:
355 send "&cYou don't need to specify a number!"
356 stop
357 else:
358 send "&cYou must specify an arena name!"
359 stop
360 if arg-1 is "addSpawn":
361 if arg-2 is set:
362 if integer arg 1 is not set:
363 if {lucky.player::%uuid of player%.playing} is not set:
364 if {lucky.arena.%arg-2%.created} is true:
365 add 1 to {lucky.arena.%arg-2%.spawn.id}
366 set {lucky.arena.%arg-2%.spawn.%{lucky.arena.%arg-2%.spawn.id}%} to location of player
367 send "&c&lSETUP &e&l» &7Spawn &anº%{lucky.arena.%arg-2%.spawn.id}% &7has been set!"
368 stop
369 else:
370 send "&cThis arena doesn't even exists!"
371 stop
372 else:
373 send "&cYou can't do this while playing!"
374 stop
375 else:
376 send "&cYou don't need to specify a number!"
377 stop
378 else:
379 send "&cYou must specify an arena name!"
380 stop
381 if arg-1 is "removeSpawn":
382 if arg-2 is set:
383 if integer arg 1 is not set:
384 if {lucky.player::%uuid of player%.playing} is not set:
385 if {lucky.arena.%arg-2%.created} is true:
386 if {lucky.arena.%arg-2%.spawn.id} is not 0:
387 send "&c&lSETUP &e&l» &7Spawn &anº%{lucky.arena.%arg-2%.spawn.id}% &7has been deleted!"
388 delete {lucky.arena.%arg-2%.spawn.%{lucky.arena.%arg-2%.spawn.id}%}
389 remove 1 from {lucky.arena.%arg-2%.spawn.id}
390 stop
391 else:
392 send "&cThere is no more spawns to remove!"
393 stop
394 else:
395 send "&cThis arena doesn't even exists!"
396 stop
397 else:
398 send "&cYou can't do this while playing!"
399 stop
400 else:
401 send "&cYou don't need to specify a number!"
402 stop
403 else:
404 send "&cYou must specify an arena name!"
405 stop
406 if arg-1 is "setarenalobby":
407 if arg-2 is set:
408 if integer arg 1 is not set:
409 if {lucky.player::%uuid of player%.playing} is not set:
410 if {lucky.arena.%arg-2%.created} is true:
411 set {lucky.arena.%arg-2%.lobby} to location of player
412 send "&c&lSETUP &e&l» &7Setted the &aArena Lobby &7to your current location!"
413 stop
414 else:
415 send "&cThis arena doesn't even exists!"
416 stop
417 else:
418 send "&cYou can't do this while playing!"
419 stop
420 else:
421 send "&cYou don't need to specify a number!"
422 stop
423 else:
424 send "&cYou must specify an arena name!"
425 stop
426 if arg-1 is "saveArena":
427 if arg-2 is set:
428 if integer arg 1 is not set:
429 if {lucky.player::%uuid of player%.playing} is not set:
430 if {lucky.arena.%arg-2%.created} is true:
431 if {lucky.arena.%arg-2%.saved} is false:
432 if {lucky.arena.%arg-2%.max} is set:
433 if {lucky.arena.%arg-2%.min} is set:
434 if {lucky.arena.%arg-2%.lobby} is set:
435 if {lucky.arena.%arg-2%.spawn.id} = {lucky.arena.%arg-2%.max}:
436 if {lucky.arena.%arg-2%.dm.id} = {lucky.arena.%arg-2%.max}:
437 send "&7Saving the arena this will take a while..."
438 wait 10 ticks
439 send "&c&lSETUP &e&l» &7The arena &a%arg-2%&7 has been saved!"
440 add arg-2 to {lucky.arenas::*}
441 set {lucky.arena.%arg-2%.saved} to true
442 set {lucky.arena.%arg-2%.status} to "{@restarting}"
443 clear player's inventory
444 clear {lucky.arena.%uuid of player%.creating}
445 lucky_resetarena(arg-2)
446 stop
447 else:
448 send "&cDeathmatch spawns need to be same count as spawns!"
449 stop
450 else:
451 send "&cYou not set spawns correctly!"
452 stop
453 else:
454 send "&cYou need to set the arena lobby!"
455 stop
456 else:
457 send "&cYou need to set the minimum players!"
458 stop
459 else:
460 send "&cYou need to set the maximum players!"
461 stop
462 else:
463 send "&cYou have already saved this arena!"
464 stop
465 else:
466 send "&cThis arena doesn't even exists!"
467 stop
468 else:
469 send "&cYou can't do this while playing!"
470 stop
471 else:
472 send "&cYou don't need to specify a number!"
473 stop
474 else:
475 send "&cYou must specify an arena name!"
476 stop
477 if arg-1 is "max":
478 if arg-2 is set:
479 if integer arg 1 is set:
480 if {lucky.player::%uuid of player%.playing} is not set:
481 if {lucky.arena.%arg-2%.created} is true:
482 if {lucky.arena.%arg-2%.saved} is false:
483 if integer arg 1 > 0:
484 set {lucky.arena.%arg-2%.max} to integer arg 1
485 send "&c&lSETUP &e&l» &7Setted the &amaximum players &7to &a%integer arg 1%&7!"
486 stop
487 else:
488 send "&cYou can't use negative number!"
489 stop
490 else:
491 send "&cThis arena is saved! That means that it is not open to any kind of modifications."
492 stop
493 else:
494 send "&cThis arena doesn't even exists!"
495 stop
496 else:
497 send "&cYou can't do this while playing!"
498 stop
499 else:
500 send "&cYou must specify a number!"
501 stop
502 else:
503 send "&cYou must specify an arena name!"
504 stop
505 if arg-1 is "min":
506 if arg-2 is set:
507 if integer arg 1 is set:
508 if {lucky.player::%uuid of player%.playing} is not set:
509 if {lucky.arena.%arg-2%.created} is true:
510 if {lucky.arena.%arg-2%.saved} is false:
511 if integer arg 1 > 0:
512 set {lucky.arena.%arg-2%.min} to integer arg 1
513 send "&c&lSETUP &e&l» &7Setted the &aminimum players &7to &a%integer arg 1%&7!"
514 stop
515 else:
516 send "&cYou can't use negative number!"
517 stop
518 else:
519 send "&cThis arena is saved! That means that it is not open to any kind of modifications."
520 stop
521 else:
522 send "&cThis arena doesn't even exists!"
523 stop
524 else:
525 send "&cYou can't do this while playing!"
526 stop
527 else:
528 send "&cYou must specify a number!"
529 stop
530 else:
531 send "&cYou must specify an arena name!"
532 stop
533 if arg-1 is "resetstats":
534 if arg-2 is set:
535 set {_player} to arg-2 parsed as player
536 set {_uuid} to uuid of {_player}
537 set {lucky.stats.kills.%{_uuid}%} to 0
538 set {lucky.stats.deaths.%{_uuid}%} to 0
539 set {lucky.stats.wins.%{_uuid}%} to 0
540 set {lucky.stats.coins.%{_uuid}%} to 0
541 send "&3&l» &c&lYou reset &c&l%arg-2%&c&l's stats"
542 else:
543 send "&3&l» &c&l/lucky resetstats <player>"
544 else:
545 send "&cYou don't have permission to execute this command!"
546 stop
547 if arg-1 is "stats":
548 if arg-2 is not set:
549 send "&8&lâ—&7&l&m----------------------&8&lâ—"
550 send ""
551 send "&3&l» &7&lKILLS &c%{lucky.stats.kills.%uuid of player%}%"
552 send "&3&l» &7&lDEATHS &c%{lucky.stats.deaths.%uuid of player%}%"
553 send "&3&l» &7&lWINS &c%{lucky.stats.wins.%uuid of player%}%"
554 send "&3&l» &7&lCOINS &c%{lucky.stats.coins.%uuid of player%}%"
555 send ""
556 send "&8&lâ—&7&l&m----------------------&8&lâ—"
557 if arg-2 is set:
558 set {_uuid} to uuid of arg-2 parsed as player
559 if {lucky.stats.kills.%{_uuid}%} is set:
560 send "&8&lâ—&7&l&m----------------------&8&lâ—"
561 send ""
562 send "&3&l» &7&lKILLS &c%{lucky.stats.kills.%{_uuid}%}%"
563 send "&3&l» &7&lDEATHS &c%{lucky.stats.deaths.%{_uuid}%}%"
564 send "&3&l» &7&lWINS &c%{lucky.stats.wins.%{_uuid}%}%"
565 send "&3&l» &7&lCOINS &c%{lucky.stats.coins.%{_uuid}%}%"
566 send ""
567 send "&8&lâ—&7&l&m----------------------&8&lâ—"
568 else:
569 send "&3&l» &7No data found for &c%arg-2%"
570 if arg-1 is "leave":
571 if {lucky.player::%uuid of player%.playing} is "InGame" or "InGameSPEC":
572 lucky_leave(player)
573 else:
574 send "&cYou are not playing in any arena!"
575 stop
576
577
578function lucky_leave(p: player):
579 lucky_clear_player({_p})
580 lucky_delete_scoreboard({_p})
581 set {_uuid} to uuid of {_p}
582 set {_arena} to {lucky.player::%{_uuid}%.arena}
583 teleport {_p} to {lucky.lobby}
584 if {lucky.player::%{_uuid}%.playing} is "InGame":
585 remove {_p} from {lucky.arena.%{_arena}%.players.alive::*} and {lucky.arena.%{_arena}%.players.death::*}
586 send "{@left-message} &7(%size of {lucky.arena.%{_arena}%.players.alive::*}%&7/%{lucky.arena.%{_arena}%.max}%&7)" to {lucky.arena.%{_arena}%.players.alive::*} and {lucky.arena.%{_arena}%.players.death::*}
587 if {lucky.arena.%{_arena}%.status} is "{@ingame}" or "{@deathmatch}":
588 size of {lucky.arena.%{_arena}%.players.alive::*} < 2
589 loop {lucky.arena.%{_arena}%.players.alive::*}:
590 lucky_winner(loop-value)
591 if {lucky.arena.%{_arena}%.status} is "{@starting}":
592 if size of {lucky.arena.%{_arena}%.players.alive::*} = 0:
593 set {lucky.arena.%{_arena}%.status} to "{@waiting}"
594 if {lucky.player::%{_uuid}%.playing} is "InGameSPEC":
595 remove {_p} from {lucky.arena.%{_arena}%.players.death::*}
596 delete {lucky.player::%{_uuid}%.playing}
597 delete {lucky.gamekills.%{_arena}%::%{_p}%}
598 delete {lucky.player::%{_uuid}%.arena}
599 delete {lucky.arena.%{_uuid}%.creating}
600
601on chat:
602 if {lucky.player::%uuid of player%.playing} is "InGame" or "InGameSPEC":
603 cancel event
604 if {lucky.player::%uuid of player%.playing} is "InGameSPEC":
605 send {@spec-chat} to {lucky.arena.%{lucky.player::%uuid of player%.arena}%.players.death::*}
606 if {lucky.player::%uuid of player%.playing} is "InGame":
607 send {@normal-chat} to {lucky.arena.%{lucky.player::%uuid of player%.arena}%.players.alive::*} and {lucky.arena.%{lucky.player::%uuid of player%.arena}%.players.death::*}
608
609
610on command:
611 if {@only-in-game-commands} is true:
612 if {lucky.player::%uuid of player%.playing} is set:
613 if command is {@in-game-commands}:
614 stop
615 if player is op:
616 stop
617 if player has permission "lucky.admin":
618 stop
619 else:
620 cancel event
621 send "{@prefix} You can't use this command in game!"
622
623
624on break:
625 if {lucky.player::%uuid of player%.playing} is "InGame":
626 if event-block is sponge:
627 if {lucky.arena.%{lucky.player::%uuid of player%.arena}%::BREAKBLOCKS::%location of event-block%} is not set:
628 set {lucky.arena.%{lucky.player::%uuid of player%.arena}%::BREAKBLOCKS::%location of event-block%} to location of event-block
629 set {lucky.arena.%{lucky.player::%uuid of player%.arena}%::BREAKBLOCKSTYPE::%location of event-block%} to type of event-block
630 cancel event
631 set event-block to air
632 show mob spawner flames at the event-block
633 set {_drop} to random element out of {LUCKY.BLOCKS::*}
634 drop {_drop} at location of event-block without velocity
635 else:
636 cancel event
637
638on place:
639 if {lucky.player::%uuid of player%.playing} is "InGame":
640 cancel event
641 if {lucky.arena.%uuid of player%.creating} is set:
642 name of item is "&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"
643 cancel event
644
645
646on hunger bar change:
647 if {lucky.player::%uuid of player%.playing} is set:
648 if {@disable-hunger-loss} is true:
649 set player's hunger to 20
650
651on chunk unload:
652 loop entities of event-chunk:
653 loop-value is a dropped item
654 loop {lucky.arenas::*}:
655 distance between loop-value-1 and {lucky.arena.%loop-value-2%.spawn.1} < 10000
656 if {lucky.arena.%loop-value-2%.status} is "{@ingame}" or "{@deathmatch}":
657 cancel event
658 else:
659 delete loop-value-1
660
661on drop:
662 if {lucky.player::%uuid of player%.playing} is "InGame":
663 if {lucky.arena.%{lucky.player::%uuid of player%.arena}%.status} is "{@waiting}" or "{@starting}":
664 cancel event
665 else:
666 if event-item is crafting table named "&aCrafting Table":
667 cancel event
668
669
670on right click:
671 if {lucky.player::%uuid of player%.playing} is "InGame":
672 if name of item is "{@leave-item-name}":
673 lucky_leave(player)
674 if event-item is crafting table:
675 open crafting table to player
676 stop
677 if {lucky.arena.%uuid of player%.creating} is set:
678 if name of item is "&7ADD SPAWN &aAND &7REMOVE SPAWN":
679 cancel event
680 make player execute command "lucky addspawn %{lucky.arena.%uuid of player%.creating}%"
681 if name of item is "&7ADD &cDM SPAWN &aAND &7REMOVE &cDM &7SPAWN":
682 cancel event
683 make player execute command "lucky adddmSpawn %{lucky.arena.%uuid of player%.creating}%"
684 if name of item is "&7SET ARENA &cLOBBY":
685 cancel event
686 make player execute command "lucky setarenalobby %{lucky.arena.%uuid of player%.creating}%"
687 if name of item is "&7SET &cMIN PLAYERS":
688 open virtual chest inventory with size 6 named "&cSET MIN" to player
689 wait 3 ticks
690 set {_amount} to -1
691 loop 55 times:
692 make a gui slot {_amount} 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%"
693 add 1 to {_amount}
694 stop
695 if name of item is "&7SET &cMAX PLAYERS":
696 open virtual chest inventory with size 6 named "&cSET MAX" to player
697 wait 3 ticks
698 set {_amount} to -1
699 loop 55 times:
700 make a gui slot {_amount} 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%"
701 add 1 to {_amount}
702 stop
703 if name of item is "&c&lSAVE ARENA":
704 cancel event
705 make player execute command "lucky saveArena %{lucky.arena.%uuid of player%.creating}%"
706 if name of item is "&c&l» &7&lARENA &c&l%{lucky.arena.%uuid of player%.creating}%":
707 cancel event
708
709on left click:
710 if name of item is "&7ADD SPAWN &aAND &7REMOVE SPAWN":
711 cancel event
712 make player execute command "lucky removespawn %{lucky.arena.%uuid of player%.creating}%"
713 if name of item is "&7ADD &cDM SPAWN &aAND &7REMOVE &cDM &7SPAWN":
714 cancel event
715 make player execute command "lucky removedmSpawn %{lucky.arena.%uuid of player%.creating}%"
716
717on pressure plate:
718 if {lucky.player::%uuid of player%.playing} is "InGame":
719 if {lucky.arena.%{lucky.player::%uuid of player%.arena}%.status} is "{@ingame}":
720 cancel event
721 if event-block is iron pressure plate:
722 block below event-block is redstone block
723 lucky_finish(player)
724 if {lucky.arena.%{lucky.player::%uuid of player%.arena}%::BREAKBLOCKS::%location of block at event-location%} is not set:
725 set {lucky.arena.%{lucky.player::%uuid of player%.arena}%::BREAKBLOCKS::%location of block at event-location%} to location of block at event-location
726 set {lucky.arena.%{lucky.player::%uuid of player%.arena}%::BREAKBLOCKSTYPE::%location of block at event-location%} to type of block at event-location
727 set block at event-location to air
728 if event-block is golden pressure plate:
729 if {lucky.arena.%{lucky.player::%uuid of player%.arena}%::BREAKBLOCKS::%location of block at event-location%} is not set:
730 set {lucky.arena.%{lucky.player::%uuid of player%.arena}%::BREAKBLOCKS::%location of block at event-location%} to location of block at event-location
731 set {lucky.arena.%{lucky.player::%uuid of player%.arena}%::BREAKBLOCKSTYPE::%location of block at event-location%} to type of block at event-location
732 set block at event-location to air
733 set {lucky.arena.%{lucky.player::%uuid of player%.arena}%.PLATES::%location of event-block%} to location of block at event-location
734 set {lucky.arena.%{lucky.player::%uuid of player%.arena}%.respawnpoint::%uuid of player%} to location of player
735 play sound "{@checkpoint-sound}" to player with volume 100.0 and pitch 100.0
736 add 1 to {lucky.checkpoints.%{lucky.player::%uuid of player%.arena}%::%player%}
737 send "{@prefix} {@checkpoint}"
738 create an animated ball effect at location of event-block with id uuid of player with particle redstone
739 wait a second
740 delete effect uuid of player
741
742
743
744on damage of player:
745 if {lucky.player::%uuid of victim%.playing} is "InGame":
746 if {lucky.arena.%{lucky.player::%uuid of victim%.arena}%.status} is "{@starting}" or "{@waiting}":
747 cancel event
748 if damage cause is void:
749 teleport victim to {lucky.arena.%{lucky.player::%uuid of victim%.arena}%.lobby}
750 if {lucky.arena.%{lucky.player::%uuid of victim%.arena}%.status} is "{@restarting}":
751 cancel event
752 if {lucky.arena.%{lucky.player::%uuid of victim%.arena}%.status} is "{@ingame}":
753 if damage cause is fall:
754 cancel event
755 if damage cause is void:
756 cancel event
757 teleport victim to {lucky.arena.%{lucky.player::%uuid of victim%.arena}%.respawnpoint::%uuid of victim%}
758 heal victim
759 if {lucky.arena.%{lucky.player::%uuid of victim%.arena}%.status} is "{@deathmatch}":
760 damage is greater than or equal to health of victim
761 cancel event
762 remove 1 from {lucky.lives.%{lucky.player::%uuid of victim%.arena}%::%uuid of victim%}
763 create an animated ball effect at location of victim with id uuid of victim with particle flame
764 play sound "{@death-sound}" to victim with volume 100.0 and pitch 100.0
765 if attacker is online:
766 add 1 to {lucky.gamekills.%{lucky.player::%uuid of attacker%.arena}%::%attacker%}
767 add 1 to {lucky.stats.kills.%uuid of attacker%}
768 add 1 to {lucky.stats.deaths.%uuid of victim%}
769 add {@coins-per-kill} to {lucky.stats.coins.%uuid of attacker%}
770 play sound "{@kill-sound}" to attacker with volume 100.0 and pitch 100.0
771 if "{@kill-command}" is not """":
772 make console execute command "{@kill-command}"
773 if {lucky.lives.%{lucky.player::%uuid of victim%.arena}%::%uuid of victim%} is 0:
774 drop all items in victim's inventory at block 1 above victim
775 set victim's gamemode to spectator
776 set {lucky.player::%uuid of victim%.playing} to "InGameSPEC"
777 set {_victim} to victim
778 remove {_victim} from {lucky.arena.%{lucky.player::%uuid of victim%.arena}%.players.alive::*}
779 add {_victim} to {lucky.arena.%{lucky.player::%uuid of victim%.arena}%.players.death::*}
780 send {_victim} title "{@death-title}" with subtitle "{@death-subtitle}" for 4 seconds
781 set {_alive} to size of {lucky.arena.%{lucky.player::%uuid of victim%.arena}%.players.alive::*}
782 set {_spec} to size of {lucky.arena.%{lucky.player::%uuid of victim%.arena}%.players.death::*}
783 if size of {lucky.arena.%{lucky.player::%uuid of victim%.arena}%.players.alive::*} is 1:
784 loop {lucky.arena.%{lucky.player::%uuid of victim%.arena}%.players.alive::*}:
785 lucky_winner(loop-value)
786 else:
787 set {_spawn} to random integer between 1 and {lucky.arena.%{lucky.player::%uuid of victim%.arena}%.max}
788 heal victim
789 teleport victim to {lucky.arena.%{lucky.player::%uuid of victim%.arena}%.dm.%{_spawn}%}
790 if attacker is online:
791 set {_attacker} to attacker
792 else:
793 set {_attacker} to "unknown"
794 send "{@prefix} {@death-message}" to {lucky.arena.%{lucky.player::%uuid of victim%.arena}%.players.alive::*} and {lucky.arena.%{lucky.player::%uuid of victim%.arena}%.players.death::*}
795 wait a second
796 delete effect uuid of victim
797
798
799
800on quit:
801 lucky_leave(player)
802
803
804function lucky_scoreboard(p: player, sb: text):
805 set {_uuid} to uuid of {_p}
806 if {_sb} is "GAME":
807 if stylish scoreboard "LUCKYGAME-%{_p}%" does not exist:
808 create new stylish scoreboard named "LUCKYGAME-%{_p}%"
809 loop 15 times:
810 create a new id based score "LUCKYGAME-%{_p}%Slot%loop-number%" with text "&%loop-number%" slot loop-number for stylish scoreboard "LUCKYGAME-%{_p}%"
811 while {lucky.arena.%{lucky.player::%{_uuid}%.arena}%.status} is "{@ingame}":
812 if {lucky.arena.%{lucky.player::%{_uuid}%.arena}%.gametime::seconds} < 10:
813 set {_game-time} to "%{lucky.arena.%{lucky.player::%{_uuid}%.arena}%.gametime::minutes}%:0%{lucky.arena.%{lucky.player::%{_uuid}%.arena}%.gametime::seconds}%"
814 else:
815 set {_game-time} to "%{lucky.arena.%{lucky.player::%{_uuid}%.arena}%.gametime::minutes}%:%{lucky.arena.%{lucky.player::%{_uuid}%.arena}%.gametime::seconds}%"
816 set title of stylish scoreboard "LUCKYGAME-%{_p}%" to "&6&lLUCKY RACE"
817 set stylish scoreboard of {_p} to "LUCKYGAME-%{_p}%"
818 set the text of id "LUCKYGAME-%{_p}%Slot15" to "&7%now%"
819 set the text of id "LUCKYGAME-%{_p}%Slot14" to "&8&l&m---------------"
820 set the text of id "LUCKYGAME-%{_p}%Slot13" to "&8&lâ— &6TIME LEFT"
821 set the text of id "LUCKYGAME-%{_p}%Slot12" to "&8&lâ— &c&l%{_game-time}%"
822 set the text of id "LUCKYGAME-%{_p}%Slot11" to "&1&e&9"
823 set the text of id "LUCKYGAME-%{_p}%Slot10" to "&7&l» &e&lMap"
824 set the text of id "LUCKYGAME-%{_p}%Slot9" to "&3&8&lâ— &6&l%{lucky.player::%{_uuid}%.arena}%"
825 set the text of id "LUCKYGAME-%{_p}%Slot8" to "&3&4"
826 set the text of id "LUCKYGAME-%{_p}%Slot7" to "&7&l» &e&lCheckpoints"
827 set the text of id "LUCKYGAME-%{_p}%Slot6" to "&4&8&lâ— &6&l%{lucky.checkpoints.%{lucky.player::%{_uuid}%.arena}%::%{_p}%}%"
828 set the text of id "LUCKYGAME-%{_p}%Slot5" to "&1&4"
829 set the text of id "LUCKYGAME-%{_p}%Slot4" to "&7&l» &e&lPLAYERS"
830 set the text of id "LUCKYGAME-%{_p}%Slot3" to "&2&8&lâ— &6&lInGame: %size of {lucky.arena.%{lucky.player::%{_uuid}%.arena}%.players.alive::*}%"
831 set the text of id "LUCKYGAME-%{_p}%Slot2" to "&8&m&l---------------"
832 set the text of id "LUCKYGAME-%{_p}%Slot1" to "{@website-name}"
833 wait a second
834 if {_sb} is "DEATHMATCH":
835 if stylish scoreboard "LUCKYDM-%{_p}%" does not exist:
836 create new stylish scoreboard named "LUCKYDM-%{_p}%"
837 loop 12 times:
838 create a new id based score "LUCKYDM-%{_p}%Slot%loop-number%" with text "&%loop-number%" slot loop-number for stylish scoreboard "LUCKYDM-%{_p}%"
839 while {lucky.arena.%{lucky.player::%{_uuid}%.arena}%.status} is "{@deathmatch}":
840 if {lucky.arena.%{lucky.player::%{_uuid}%.arena}%.gametime::seconds} < 10:
841 set {_game-time} to "%{lucky.arena.%{lucky.player::%{_uuid}%.arena}%.gametime::minutes}%:0%{lucky.arena.%{lucky.player::%{_uuid}%.arena}%.gametime::seconds}%"
842 else:
843 set {_game-time} to "%{lucky.arena.%{lucky.player::%{_uuid}%.arena}%.gametime::minutes}%:%{lucky.arena.%{lucky.player::%{_uuid}%.arena}%.gametime::seconds}%"
844 set title of stylish scoreboard "LUCKYDM-%{_p}%" to "&6&lLUCKY RACE"
845 set stylish scoreboard of {_p} to "LUCKYDM-%{_p}%"
846 set the text of id "LUCKYDM-%{_p}%Slot12" to "&7%now%"
847 set the text of id "LUCKYDM-%{_p}%Slot11" to "&8&l&m---------------"
848 set the text of id "LUCKYDM-%{_p}%Slot10" to "&8&lâ— &6TIME LEFT"
849 set the text of id "LUCKYDM-%{_p}%Slot9" to "&8&lâ— &c&l%{_game-time}%"
850 set the text of id "LUCKYDM-%{_p}%Slot8" to "&1&e&9"
851 set the text of id "LUCKYDM-%{_p}%Slot7" to "&7&l» &c⤠&6&lLEFT"
852 set the text of id "LUCKYDM-%{_p}%Slot6" to "&3&8&lâ— &6&l%{lucky.lives.%{lucky.player::%{_uuid}%.arena}%::%{_uuid}%}%"
853 set the text of id "LUCKYDM-%{_p}%Slot5" to "&3&4"
854 set the text of id "LUCKYDM-%{_p}%Slot4" to "&7&l» &e&lPLAYERS"
855 set the text of id "LUCKYDM-%{_p}%Slot3" to "&2&8&lâ— &6&lInGame: %size of {lucky.arena.%{lucky.player::%{_uuid}%.arena}%.players.alive::*}%"
856 set the text of id "LUCKYDM-%{_p}%Slot2" to "&8&m&l---------------"
857 set the text of id "LUCKYDM-%{_p}%Slot1" to "{@website-name}"
858 wait a second
859 if {_sb} is "LOBBY":
860 if stylish scoreboard "LUCKYLOBBY-%{_p}%" does not exist:
861 create new stylish scoreboard named "LUCKYLOBBY-%{_p}%"
862 loop 12 times:
863 create a new id based score "LUCKYLOBBY-%{_p}%Slot%loop-number%" with text "&%loop-number%" slot loop-number for stylish scoreboard "LUCKYLOBBY-%{_p}%"
864 while {lucky.arena.%{lucky.player::%{_uuid}%.arena}%.status} is "{@waiting}" or "{@starting}":
865 set title of stylish scoreboard "LUCKYLOBBY-%{_p}%" to "&6&lLUCKY RACE"
866 set stylish scoreboard of {_p} to "LUCKYLOBBY-%{_p}%"
867 set the text of id "LUCKYLOBBY-%{_p}%Slot12" to "&7%now%"
868 set the text of id "LUCKYLOBBY-%{_p}%Slot11" to "&8&l&m---------------"
869 set the text of id "LUCKYLOBBY-%{_p}%Slot10" to "&8&lâ— &6STARTING IN"
870 set the text of id "LUCKYLOBBY-%{_p}%Slot9" to "&9&8&lâ— &e%{lucky.arena.%{lucky.player::%{_uuid}%.arena}%.seconds}%"
871 set the text of id "LUCKYLOBBY-%{_p}%Slot8" to "&1&e&9"
872 set the text of id "LUCKYLOBBY-%{_p}%Slot7" to "&7&l» &e&lMap"
873 set the text of id "LUCKYLOBBY-%{_p}%Slot6" to "&1&8&lâ— &6&l%{lucky.player::%{_uuid}%.arena}%"
874 set the text of id "LUCKYLOBBY-%{_p}%Slot5" to "&1&4"
875 set the text of id "LUCKYLOBBY-%{_p}%Slot4" to "&7&l» &e&lPLAYERS"
876 set the text of id "LUCKYLOBBY-%{_p}%Slot3" to "&8&lâ— &6&lLobby: %size of {lucky.arena.%{lucky.player::%{_uuid}%.arena}%.players.alive::*}%"
877 set the text of id "LUCKYLOBBY-%{_p}%Slot2" to "&8&m&l---------------"
878 set the text of id "LUCKYLOBBY-%{_p}%Slot1" to "{@website-name}"
879 wait a second
880
881
882function lucky_delete_scoreboard(p: player):
883 loop "LUCKYLOBBY" and "LUCKYGAME" and "LUCKYDM":
884 if stylish scoreboard "%loop-value%-%{_p}%" exist:
885 delete stylish scoreboard "%loop-value%-%{_p}%"
886 stop
887
888
889
890on load:
891 send "&7&l--------------------------------------------" to console
892 send " " to console
893 send "{@prefix} &aLoading &ev.{@plugin-version}&a..." to console
894 wait 1 tick
895 send "{@prefix} &e%size of {lucky.arenas::*}% &agames loaded!" to console
896 wait 1 tick
897 send "{@prefix} &a&lPlugin loaded!" to console
898 send " " to console
899 send "&7&l--------------------------------------------" to console
900 delete {lucky.player::*}
901 loop {lucky.arenas::*}:
902 lucky_resetarena(loop-value)
903 wait 1 seconds
904
905on unload:
906 send "&7&l--------------------------------------------" to console
907 send " " to console
908 send "{@prefix} &aDisabling &ev.{@plugin-version}&a..." to console
909 send "{@prefix} &ev.{@plugin-version} &adisabled!" to console
910 send " " to console
911 send "&7&l--------------------------------------------" to console
912 stop
913
914
915
916function lucky_resetarena(arena: text):
917 set {lucky.arena.%{_arena}%.status} to "{@restarting}"
918 send "{@prefix} &aReseting &e%{_arena}%" to console
919 delete {lucky.arena.%{_arena}%.CHEST::*}
920 delete {lucky.arena.%{_arena}%.players.death::*}
921 delete {lucky.arena.%{_arena}%.players.alive::*}
922 delete {lucky.arena.%{_arena}%.gametime::*}
923 delete {lucky.gamekills.%{_arena}%::*}
924 delete {lucky.lives.%{_arena}%::*}
925 delete {lucky.arena.%{_arena}%.respawnpoint::*}
926 delete {lucky.checkpoints.%{_arena}%::*}
927 set {lucky.arena.%{_arena}%.seconds} to {@waiting-time}
928 set {lucky.arena.%{_arena}%.status} to "{@waiting}"
929 loop {lucky.arena.%{_arena}%::BREAKBLOCKS::*}:
930 set block at location of {lucky.arena.%{_arena}%::BREAKBLOCKS::%loop-index%} to {lucky.arena.%{_arena}%::BREAKBLOCKSTYPE::%loop-index%}
931 wait 1 ticks
932 loop all entities:
933 world of loop-entity is {lucky.arena.%{_arena}%.spawn.1}'s world
934 loop-entity is dropped item
935 clear loop-entity
936 delete {lucky.arena.%{_arena}%::BREAKBLOCKS::*} and {lucky.arena.%{_arena}%::BREAKBLOCKSTYPE::*}
937 if "{@arena-reset-command}" is not """":
938 make console execute command "{@arena-reset-command}"
939 lucky_refreshmenu()
940 send "{@prefix} &e%{_arena}% &areseted!" to console
941 stop
942
943function lucky_join(p: player, arena: text):
944 if size of {lucky.arena.%{_arena}%.players.alive::*} >= {lucky.arena.%{_arena}%.max}:
945 send "{@prefix} {@full-arena-msg}" to {_p}
946 stop
947 set {_uuid} to uuid of {_p}
948 lucky_clear_player({_p})
949 set {lucky.player::%{_uuid}%.playing} to "InGame"
950 set {lucky.player::%{_uuid}%.arena} to {_arena}
951 add {_p} to {lucky.arena.%{_arena}%.players.alive::*}
952 teleport {_p} to {lucky.arena.%{_arena}%.lobby}
953 set {_p}'s slot 8 to {@leave-item} named "{@leave-item-name}"
954 send "{@join-message}" to {lucky.arena.%{_arena}%.players.alive::*}
955 set {lucky.gamekills.%{lucky.player::%{_uuid}%.arena}%::%{_p}%} to 0
956 lucky_scoreboard({_p}, "LOBBY")
957 lucky_refreshmenu()
958 if size of {lucky.arena.%{_arena}%.players.alive::*} = {lucky.arena.%{_arena}%.min}:
959 set {lucky.arena.%{_arena}%.status} to "{@starting}"
960 set {_sec} to {lucky.arena.%{_arena}%.seconds}
961 send "{@prefix} {@starting-in}" to {lucky.arena.%{_arena}%.players.alive::*}
962 loop {lucky.arena.%{_arena}%.seconds} times:
963 remove 1 from {lucky.arena.%{_arena}%.seconds}
964 set {_sec} to {lucky.arena.%{_arena}%.seconds}
965 wait 1 seconds
966 if {_sec} <= 5:
967 if {_sec} is greater than 0:
968 send {lucky.arena.%{_arena}%.players.alive::*} title "{@starting-title}" with subtitle "{@starting-subtitle}" for 0.8 seconds
969 send "{@prefix} {@starting-in}" to {lucky.arena.%{_arena}%.players.alive::*}
970 play sound "{@join-sound}" to {lucky.arena.%{_arena}%.players.alive::*} with volume 100.0 and pitch 100.0
971
972 if {_sec} <= 0:
973 if size of {lucky.arena.%{_arena}%.players.alive::*} >= 2:
974 send "{@prefix} {@start-message}" to {lucky.arena.%{_arena}%.players.alive::*}
975 set {lucky.arena.%{_arena}%.status} to "{@ingame}"
976 lucky_gametime({_arena})
977 set {_spawn} to 1
978 loop {lucky.arena.%{_arena}%.players.alive::*}:
979 lucky_clear_player(loop-value-2)
980 teleport loop-value-2 to {lucky.arena.%{_arena}%.spawn.%{_spawn}%}
981 set {lucky.arena.%{_arena}%.respawnpoint::%uuid of loop-value-2%} to {lucky.arena.%{_arena}%.spawn.%{_spawn}%}
982 set {lucky.checkpoints.%{lucky.player::%uuid of loop-value-2%.arena}%::%loop-value-2%} to 0
983 set slot 0 of loop-value-2 to iron_sword
984 set slot 1 of loop-value-2 to iron_pickaxe
985 set slot 8 of loop-value-2 to crafting table named "&aCrafting Table"
986 lucky_scoreboard(loop-value-2, "GAME")
987 add 1 to {_spawn}
988 wait 1 tick
989 else:
990 set {lucky.arena.%{_arena}%.seconds} to {@waiting-time}
991 set {lucky.arena.%{_arena}%.status} to "{@waiting}"
992 send "{@prefix} &cThere are not enought players to start!" to {lucky.arena.%{_arena}%.players.alive::*}
993 stop
994
995
996function lucky_gametime(arena: text):
997 set {lucky.arena.%{_arena}%.gametime::minutes} to {@game-minutes}-1
998 set {lucky.arena.%{_arena}%.gametime::seconds} to 60
999 while {lucky.arena.%{_arena}%.status} is "{@ingame}":
1000 remove 1 from {lucky.arena.%{_arena}%.gametime::seconds}
1001
1002 if {lucky.arena.%{_arena}%.gametime::seconds} is 0:
1003 set {lucky.arena.%{_arena}%.gametime::seconds} to 59
1004 remove 1 from {lucky.arena.%{_arena}%.gametime::minutes}
1005
1006 if {lucky.arena.%{_arena}%.gametime::minutes} = 0:
1007 if {lucky.arena.%{_arena}%.gametime::seconds} <= 1:
1008 set {lucky.arena.%{_arena}%.gametime::seconds} to 0
1009 set {lucky.arena.%{_arena}%.gametime::minutes} to 0
1010 lucky_deathmatch({_arena})
1011 stop
1012 wait 1 second
1013
1014function lucky_deathmatch(arena: text):
1015 set {lucky.arena.%{_arena}%.gametime::minutes} to 2
1016 set {lucky.arena.%{_arena}%.gametime::seconds} to 60
1017 set {lucky.arena.%{_arena}%.status} to "{@deathmatch}"
1018
1019 loop {lucky.arena.%{_arena}%.players.alive::*}:
1020 add 1 to {_spawn}
1021 set loop-value's gamemode to spectator
1022 teleport loop-value to {lucky.arena.%{_arena}%.dm.%{_spawn}%}
1023 set {lucky.lives.%{lucky.player::%uuid of loop-value%.arena}%::%uuid of loop-value%} to 3
1024 set loop-value's gamemode to survival
1025 lucky_scoreboard(loop-value, "DEATHMATCH")
1026
1027 while {lucky.arena.%{_arena}%.status} = "{@deathmatch}":
1028 remove 1 from {lucky.arena.%{_arena}%.gametime::seconds}
1029 if {lucky.arena.%{_arena}%.gametime::seconds} = 0:
1030 set {lucky.arena.%{_arena}%.gametime::seconds} to 59
1031 remove 1 from {lucky.arena.%{_arena}%.gametime::minutes}
1032 if {lucky.arena.%{_arena}%.gametime::minutes} = 0:
1033 if {lucky.arena.%{_arena}%.gametime::seconds} <= 1:
1034 lucky_endgame({_arena})
1035 stop
1036 wait 1 second
1037
1038
1039
1040
1041function lucky_endgame(arena: text):
1042 while {lucky.arena.%{_arena}%.status} is "{@deathmatch}":
1043 size of {lucky.arena.%{_arena}%.players.alive::*} > 1
1044 set {_p} to random element out of {lucky.arena.%{_arena}%.players.alive::*}
1045 make safe explosion with power 1 at {_p}
1046 wait 1 second
1047
1048
1049
1050function lucky_finish(p: player):
1051 set {_uuid} to uuid of {_p}
1052 send {_p} title "{@finish-title}" with subtitle "{@finish-subtitle}" for 5 seconds
1053 send "{@finish-message}" to {lucky.arena.%{lucky.player::%{_uuid}%.arena}%.players.alive::*}
1054 set {lucky.arena.%{lucky.player::%{_uuid}%.arena}%.gametime::minutes} to 0
1055 if {lucky.arena.%{lucky.player::%{_uuid}%.arena}%.gametime::seconds} > {@short-time-to}:
1056 set {lucky.arena.%{lucky.player::%{_uuid}%.arena}%.gametime::seconds} to {@short-time-to}
1057 add {@reach-final} to {lucky.stats.coins.%{_uuid}%}
1058 loop 5 times:
1059 if {lucky.player::%{_uuid}%.playing} is "InGame":
1060 launch trailing flickering star coloured purple and red fading to yellow at {_p}'s location timed 1
1061 wait 10 ticks
1062 else:
1063 stop loop
1064 stop
1065
1066
1067
1068function lucky_refreshmenu():
1069 loop all players:
1070 if inventory name of loop-player-1's current inventory is "{@arenas-list-name}":
1071 set {_slot} to 10
1072 loop {lucky.arenas::*}:
1073 if {lucky.arena.%loop-value-2%.status} is "{@ingame}" or "{@restarting}":
1074 make a gui slot {_slot} 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%size of {lucky.arena.%loop-value-2%.players.alive::*}%/%{lucky.arena.%loop-value-2%.max}%||||&8&l◠&7&lClick to spectate!" to run loop-player-1 command "lucky join %loop-value-2%"
1075 else:
1076 make a gui slot {_slot} 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%size of {lucky.arena.%loop-value-2%.players.alive::*}%/%{lucky.arena.%loop-value-2%.max}%||||&8&l◠&7&lClick to join!" to run loop-player-1 command "lucky join %loop-value-2%"
1077 add 1 to {_slot}
1078 if {_slot} is 17 or 26 or 35:
1079 add 2 to {_slot}
1080
1081
1082function lucky_clear_player(p: player):
1083 milk {_p}
1084 heal {_p}
1085 extinguish {_p}
1086 set {_p}'s food to 20
1087 clear {_p}'s level
1088 clear {_p}'s inventory
1089 close {_p}'s inventory
1090 set {_p}'s gamemode to survival
1091 set {_p}'s flight mode to false
1092
1093function lucky_winner(p: player):
1094 set {_uuid} to uuid of {_p}
1095 set {_arena} to {lucky.player::%{_uuid}%.arena}
1096 set {lucky.arena.%{_arena}%.status} to "{@restarting}"
1097 lucky_summary({_p}, {_arena})
1098 lucky_clear_player({_p})
1099 send {_p} title "{@winner-title}" with subtitle "{@winner-subtitle}" for 7 seconds
1100 add 1 to {lucky.stats.wins.%{_uuid}%}
1101 add {@coins-per-win} to {lucky.stats.coins.%{_uuid}%}
1102 if "{@win-command}" is not """":
1103 make console execute command "{@win-command}"
1104 loop 15 times:
1105 if {lucky.player::%{_uuid}%.playing} is "InGame":
1106 launch trailing flickering star coloured purple and red fading to yellow at {_p}'s location timed 1
1107 wait 10 ticks
1108 wait {@win-lenght} seconds
1109 loop {lucky.arena.%{_arena}%.players.alive::*} and {lucky.arena.%{_arena}%.players.death::*}:
1110 lucky_clear_player(loop-value)
1111 teleport loop-value to {lucky.lobby}
1112 delete {lucky.player::%uuid of loop-value%.playing}
1113 lucky_delete_scoreboard(loop-value)
1114 lucky_resetarena({_arena})
1115 stop
1116
1117
1118function lucky_summary(p: player, arena: text):
1119 set {_uuid} to uuid of {_p}
1120 loop {lucky.gamekills.%{_arena}%::*}:
1121 set {_backup::%loop-index%} to loop-value
1122 loop 3 times:
1123 delete {_first.player}
1124 delete {_first.number}
1125 loop {_backup::*}:
1126 if {_first.player} is not set:
1127 set {_first.number} to loop-value-2
1128 set {_first.player} to loop-index
1129 else:
1130 if loop-value-2 > {_first.number}:
1131 set {_first.number} to loop-value-2
1132 set {_first.player} to loop-index
1133 add {_first.number} to {_list::*}
1134 add {_first.player} to {_list2::*}
1135 delete {_backup::%{_first.player}%}
1136 if {_list::1} is not set:
1137 set {_list::1} to 0
1138 if {_list::2} is not set:
1139 set {_list::2} to 0
1140 if {_list::3} is not set:
1141 set {_list::3} to 0
1142 if {_list2::1} is not set:
1143 set {_list2::1} to "Nobody"
1144 if {_list2::2} is not set:
1145 set {_list2::2} to "Nobody"
1146 if {_list2::3} is not set:
1147 set {_list2::3} to "Nobody"
1148 if {lucky.checkpoints.%{_arena}%::%{_list2::2}%} is not set:
1149 set {lucky.checkpoints.%{_arena}%::%{_list2::2}%} to 0
1150 if {lucky.checkpoints.%{_arena}%::%{_list2::3}%} is not set:
1151 set {lucky.checkpoints.%{_arena}%::%{_list2::3}%} to 0
1152 set {_players.total::*} to {lucky.arena.%{_arena}%.players.alive::*} and {lucky.arena.%{_arena}%.players.death::*}
1153 wait a tick
1154 send "&3&lâ– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– " to {_players.total::*}
1155 send " " to {_players.total::*}
1156 send " &8&lâ— &f&lLucky Race &8&lâ— " to {_players.total::*}
1157 send " " to {_players.total::*}
1158 send " &eWinner &f- &3%{_p}'s displayname% " to {_players.total::*}
1159 send " " to {_players.total::*}
1160 send " &c&l» &e&l1st Place &8&l» &3%{_list2::1}%" to {_players.total::*}
1161 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::*}
1162 send " &c&l» &e&l2nd Place &8&l» &7%{_list2::2}%" to {_players.total::*}
1163 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::*}
1164 send " &c&l» &e&l3rd Place &8&l» &7%{_list2::3}%" to {_players.total::*}
1165 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::*}
1166 send " " to {_players.total::*}
1167 send "&3&lâ– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– " to {_players.total::*}