· 6 years ago · Jan 01, 2020, 10:40 AM
1#Read 'license.txt' before using this Skript please
2
3options:
4 logo: &e&lServer &7➤&f
5 lobby: &dLobby &7➤&f
6 config: plugins/Lobby/config.yml
7
8#-----------------------------------{ Functions / Startup }-----------------------------------
9function startUp():
10 clear {config.list.interaction::*}
11 clear {config.list.join::*}
12 add "trapdoor", "armor_stand", "item_frame", "button", "furnace", "chest", "trapped_chest", "crafting_table" and "door" to {config.list.interaction::*}
13 add "teleportLobby", "clearJoinMessage" and "clearPlayer" to {config.list.join::*}
14
15 if file "{@config}" doesn't exist:
16 create file "{@config}"
17
18 loop {config.list.interaction::*}:
19 set yml value "Lobby.Interaction.%loop-value%" of file "{@config}" to false
20
21 loop {config.list.join::*}:
22 set yml value "Lobby.Join.%loop-value%" of file "{@config}" to true
23
24 set yml value "Lobby.Join.Compass.give" of file "{@config}" to true
25 set yml value "Lobby.Join.Compass.item" of file "{@config}" to "compass"
26 set yml value "Lobby.Join.Compass.name" of file "{@config}" to "&9Compass"
27 set yml value "Lobby.Join.Compass.lore" of file "{@config}" to "&7Click to use"
28 set yml value "Lobby.Join.Compass.GUI.name" of file "{@config}" to "&9Minigames"
29 set yml value "Lobby.Join.Compass.GUI.rows" of file "{@config}" to 3
30 set yml value "Lobby.Join.teleportLobby" of file "{@config}" to true
31 set yml value "Lobby.Join.Message.clear" of file "{@config}" to true
32 set yml value "Lobby.Join.Message.message" of file "{@config}" to "{@lobby} &f[player] joined the lobby!"
33
34 else:
35 loop {config.list.interaction::*}:
36 if yml value "Lobby.Interaction.%loop-value%" of file "{@config}" is not set:
37 set yml value "Lobby.Interaction.%loop-value%" of file "{@config}" to false
38
39 loop {config.list.join::*}:
40 if yml value "Lobby.Join.%loop-value%" of file "{@config}" is not set:
41 set yml value "Lobby.Join.%loop-value%" of file "{@config}" to true
42
43 if yml value "Lobby.Join.Compass.give" of file "{@config}" is not set:
44 set yml value "Lobby.Join.Compass.give" of file "{@config}" to true
45 if yml value "Lobby.Join.Compass.item" of file "{@config}" is not set:
46 set yml value "Lobby.Join.Compass.item" of file "{@config}" to "compass"
47 if yml value "Lobby.Join.Compass.name" of file "{@config}" is not set:
48 set yml value "Lobby.Join.Compass.name" of file "{@config}" to "&9Minigames"
49 if yml value "Lobby.Join.Compass.lore" of file "{@config}" is not set:
50 set yml value "Lobby.Join.Compass.lore" of file "{@config}" to "&7Click to use"
51 if yml value "Lobby.Join.Compass.GUI.name" of file "{@config}" is not set:
52 set yml value "Lobby.Join.Compass.GUI.name" of file "{@config}" to "&9Minigames"
53 if yml value "Lobby.Join.Compass.GUI.rows" of file "{@config}" is not set:
54 set yml value "Lobby.Join.Compass.GUI.rows" of file "{@config}" to 3
55
56 if yml value "Lobby.Join.teleportLobby" of file "{@config}" is not set:
57 set yml value "Lobby.Join.teleportLobby" of file "{@config}" to true
58 if yml value "Lobby.Join.Message.clear" of file "{@config}" is not set:
59 set yml value "Lobby.Join.Message.clear" of file "{@config}" to true
60 if yml value "Lobby.Join.Message.message" of file "{@config}" is not set:
61 set yml value "Lobby.Join.Message.message" of file "{@config}" to "{@lobby} &f[player] joined the lobby!"
62 if yml value "Lobby.Join.clearPlayer" of file "{@config}" is not set:
63 set yml value "Lobby.Join.clearPlayer" of file "{@config}" to true
64
65 setupCompass()
66
67on enable:
68 startUp()
69
70
71#-----------------------------------{ Functions / Disable }-----------------------------------
72
73
74#-----------------------------------{ Functions / Join and Quit }-----------------------------------
75on join:
76 if {lobby.location} is set:
77 if {lobby.teleportLobby} is set:
78 teleport player to {lobby.location}
79
80 if {lobby.clearJoinMessage} is true:
81 set join message to ""
82 if {lobby.joinMessage} is set:
83 set {_message} to {lobby.joinMessage}
84 replace all "[player]" in {_message} with "%name of player%"
85 send "%{_message}%" to all players in world of player
86
87 if {lobby.clearPlayer} is true:
88 clear player's inventory
89 set player's level to 0
90
91 if {lobby.giveCompass} is true:
92 set slot 4 of player to {lobby.items.compass}
93
94 if {lobby.buildmode.removeLeft.%player%} is set:
95 delete {lobby.buildmode.removeLeft.%player%}
96 send "{@logo} Your buildmode has been &ddisabled &fin the &dlobby &fbecause you left."
97
98on quit:
99 if {lobby.buildmode.%player%} is true:
100 delete {lobby.buildmode.%player%}
101 set {lobby.buildmode.removeLeft.%player%} to true
102
103#-----------------------------------{ Functions / Compass }-----------------------------------
104function closeEvent(p: Player, command: Boolean, accept: String):
105 if {_command} is true:
106 execute {_p} command {_accept}
107
108 else:
109 send "%{_accept}%" to {_p}
110
111
112function setupCompass():
113 set {_compassItem} to yml value "Lobby.Join.Compass.item" of file "{@config}"
114 set {_compassName} to yml value "Lobby.Join.Compass.name" of file "{@config}"
115 set {_compassLore} to yml value "Lobby.Join.Compass.lore" of file "{@config}"
116
117 if {_compassItem} parsed as an item type is not set:
118 send "{@lobby} &4[ERROR] &d%{_compassItem}% &7is not an item! Setting the item to a compass..." to console
119 set {_compassItem} to a compass
120
121 if {_compassName} is not set:
122 send "{@lobby} &4[ERROR] &7There is no &dname &7given for the compass!" to console
123 set {_compassName} to "%name of {_compassItem}%"
124
125 if {_compassLore} is not set:
126 send "{@lobby} &4[ERROR] &7There is no &dlore &7given for the compass!" to console
127 set {_compassLore} to ""
128
129 loop {config.list.interaction::*}:
130 set {lobby.interaction.%loop-value%} to yml value "Lobby.Interaction.%loop-value%" of file "{@config}"
131 loop {config.list.join::*}:
132 set {lobby.join.%loop-value%} to yml value "Lobby.Join.%loop-value%" of file "{@config}"
133
134
135 set {lobby.items.compass} to ({_compassItem} parsed as an item type) named "%{_compassName}%" with lore "%{_compassLore}%"
136 set {lobby.items.compass.guiName} to yml value "Lobby.Join.Compass.GUI.name" of file "{@config}"
137 set {lobby.items.compass.rows} to yml value "Lobby.Join.Compass.GUI.rows" of file "{@config}"
138 set {lobby.joinMessage} to yml value "Lobby.Join.Message.message" of file "{@config}"
139 set {lobby.giveCompass} to yml value "Lobby.Join.Compass.give" of file "{@config}"
140
141function createCompassGUI(p: Player, gname: String, rows: Integer, slot1: Integer, slot2: Integer, item1: Item, item2: Item, i1name: String, i2name: String, accept: String, deny: String, command: Boolean):
142 wait 2 ticks
143 open chest with {_rows} rows named {_gname} to {_p}
144 wait 2 ticks
145
146 set name of {_item1} to {_i1name}
147 set name of {_item2} to {_i2name}
148
149 format slot {_slot1} of {_p} with {_item1} to close then run [closeEvent({_p}, {_command}, {_accept})]
150
151 format slot {_slot2} of {_p} with {_item2} to close then run [send "%{_deny}%" to {_p}]
152
153
154function teleportMinigame(p: Player, minigame: String):
155 if {lobby.minigames.%{_minigame}%} is set:
156 teleport {_p} to {lobby.minigames.%{_minigame}%.spawn}
157
158 else:
159 send "{@logo} Error whilst connecting to &d%{_minigame}%&f! Please report this error to staff." to {_p}
160
161function openCompass(p: Player):
162 if {lobby.items.compass.rows} is not set:
163 set {lobby.items.compass.rows} to 3
164
165 wait 2 ticks
166 open chest with {lobby.items.compass.rows} rows named "%{lobby.items.compass.guiName}%" to {_p}
167 wait 2 ticks
168
169 loop {lobby.minigames.list::*}:
170 if "%{lobby.minigames.%loop-value%.slot}%" starts with "-":
171 send "{@lobby} &4[ERROR] &d%{_p}% &7has opened the compass with the following error:" and "&d%{lobby.minigames.%loop-value%.slot}% &fstarts with '-'" to console
172
173 else:
174 if ("%{lobby.minigames.%loop-value%.slot}%" parsed as a number) is set:
175 if ("%{lobby.minigames.%loop-value%.item}%" parsed as an item type) is set:
176 set {_item} to {lobby.minigames.%loop-value%.item}
177
178 else:
179 set {_item} to paper
180
181 set {_slot} to ("%{lobby.minigames.%loop-value%.slot}%" parsed as a number)
182
183
184 if {lobby.minigames.%loop-value%.name} is set:
185 if {lobby.minigames.%loop-value%.name} is not "&cNone":
186 set {_name} to "%{lobby.minigames.%loop-value%.name}%"
187 replace all "&" in {_name} with "§"
188 if {lobby.mingames.%loop-value%.lore} is set:
189 if {lobby.minigames.%loop-value%.lore} is not "&cNone":
190 set {_lore} to "%{lobby.minigames.%loop-value%.lore}%"
191 replace all "&" in {_lore} with "§"
192 format slot {_slot} of {_p} with ("%{lobby.minigames.%loop-value%.item}%" parsed as an item) named "%{_name}%" with lore "%{_lore}%" to close then run [teleportMinigame({_p}, loop-value)]
193 else:
194 format slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item named "%{_name}%" to close then run [teleportMinigame({_p}, loop-value)]
195 else:
196 format slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item named "%{_name}%" to close then run [teleportMinigame({_p}, loop-value)]
197 else:
198 format slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item to run [teleportMinigame({_p}, loop-value)]
199 else:
200 format slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item to close then run [teleportMinigame({_p}, loop-value)]
201 else:
202 send "{@lobby} &4[ERROR] &d%{_p}% &7has opened the compass with the following error:" and "&d%{lobby.minigames.%loop-value%.slot}% &fis not a number" to console
203
204#-----------------------------------{ Player Interaction / Damage / Chat }-----------------------------------
205on damage:
206 if world of victim is {lobby.world}:
207 if damage cause is ("void" parsed as a damage cause):
208 set victim's health to 0
209
210 else:
211 cancel event
212
213on death:
214 if world of player is {lobby.world}:
215 set death message to ""
216
217on respawn:
218 if world of player is {lobby.world}:
219 set slot 4 of player to {lobby.items.compass}
220 teleport player to {lobby.location}
221
222on inventory click:
223 if world of player is {lobby.world}:
224 if {lobby.buildmode.%player%} is not set:
225 cancel event
226
227on click:
228 if world of player is {lobby.world}:
229 if player's held item is {lobby.items.compass}:
230 cancel event
231 openCompass(player)
232
233on drop:
234 if world of player is {lobby.world}:
235 if {lobby.buildmode.%player%} is not set:
236 cancel event
237
238on break:
239 if world of player is {lobby.world}:
240 if {lobby.buildmode.%player%} is not set:
241 send "{@lobby} You can't do this!"
242 cancel event
243
244on place:
245 if world of player is {lobby.world}:
246 if {lobby.buildmode.%player%} is not set:
247 cancel event
248
249on chat:
250 if world of player is {lobby.world}:
251 cancel event
252 wait 1 tick
253
254 if {cancelMessage.%player%} is true:
255 delete {cancelMessage.%player%}
256
257 else:
258 #Permissions File
259 send "&8[&e%player%&8] &7➣ &f%message%" to all players in world of player
260 send "&8[&6LOBBY&8]&8[&e%player%&8] &7➣ &f%message%" to console
261
262on rightclick on trapdoor:
263 if world of player is {lobby.world}:
264 if {lobby.interaction.trapdoor} is false:
265 cancel event
266
267on rightclick on door:
268 if world of player is {lobby.world}:
269 if {lobby.interaction.door} is false:
270 if {lobby.buildmode.%player%} is not set:
271 cancel event
272
273
274on rightclick on item_frame:
275 if world of player is {lobby.world}:
276 if {lobby.interaction.item_frame} is false:
277 if {lobby.buildmode.%player%} is not set:
278 cancel event
279
280on rightclick on button:
281 if world of player is {lobby.world}:
282 if {lobby.interaction.button} is false:
283 if {lobby.buildmode.%player%} is not set:
284 cancel event
285
286on rightclick on armor_stand:
287 if world of player is {lobby.world}:
288 if {lobby.interaction.armor_stand} is false:
289 if {lobby.buildmode.%player%} is not set:
290 cancel event
291
292on rightclick on furnace:
293 if world of player is {lobby.world}:
294 if {lobby.interaction.button} is false:
295 if {lobby.buildmode.%player%} is not set:
296 close player's inventory
297 cancel event
298
299on rightclick on chest:
300 if world of player is {lobby.world}:
301 if {lobby.interaction.chest} is false:
302 if {lobby.buildmode.%player%} is not set:
303 close player's inventory
304 cancel event
305
306on rightclick on trapped chest:
307 if world of player is {lobby.world}:
308 if {lobby.interaction.trapped_chest} is false:
309 if {lobby.buildmode.%player%} is not set:
310 close player's inventory
311 cancel event
312
313on rightclick on crafting table:
314 if world of player is {lobby.world}:
315 if {lobby.interaction.crafting_table} is false:
316 if {lobby.buildmode.%player%} is not set:
317 close player's inventory
318 cancel event
319
320#-----------------------------------{ Lobby Functions / Command }-----------------------------------
321function sendMessage(p: Player, useTTP: Boolean, useCMD: Boolean, useSGT: Boolean, ttp: String, cmd: String, sgt: String, message: String):
322 if {_useTTP} is true:
323 set {_ttp} to "<ttp:%{_ttp}%>"
324
325 else:
326 set {_ttp} to ""
327
328 if {_useCMD} is true:
329 set {_cmd} to "<cmd:%{_cmd}%>"
330 set {_sgt} to ""
331
332 else if {_useSGT} is true:
333 set {_sgt} to "<sgt:%{_sgt}%>"
334 set {_cmd} to ""
335
336 send "%{_ttp}%%{_cmd}%%{_sgt}%%{_message}%" to {_p}
337
338function detectPermission(p: Player, type: String, perm: String, useTTP: Boolean, useCMD: Boolean, useSGT: Boolean, ttp: String, cmd: String, sgt: String, message: String):
339 if {_type} is "lobby":
340 if {_p} has permission "op" or "lobby.*" or "lobby.%{_perm}%":
341 sendMessage({_p}, {_useTTP}, {_useCMD}, {_useSGT}, {_ttp}, {_cmd}, {_sgt}, {_message})
342
343 else if {_type} is "lobbyCompass":
344 if {_p} has permission "op" or "lobby.*" or "lobby.compass.*" or "lobby.compass.%{_perm}%":
345 sendMessage({_p}, {_useTTP}, {_useCMD}, {_useSGT}, {_ttp}, {_cmd}, {_sgt}, {_message})
346
347
348function teleportLobby(p: Player, w: World):
349 if {lobby.location} is set:
350
351 if {_w} is {lobby.world}:
352 teleport {_p} to {lobby.location}
353
354 else:
355 teleport {_p} to {lobby.location}
356 send "World" to console
357 wait 1 tick
358 set {_message} to {lobby.joinMessage}
359 replace "[player]" in {_message} with "%name of {_p}%"
360 send "%{_message}%" to all players in world {lobby.world}
361 send "&8[&6LOBBY&8]%{_message}%" to console
362 clear {_p}'s inventory
363 set slot 4 of {_p} to {lobby.items.compass}
364
365 else:
366 send "{@lobby} The &elobby &fis &enot set&f!" to {_p}
367
368
369command /lobby [<text>] [<text>]:
370 aliases: /hub
371 trigger:
372 if executor is player:
373 if player has permission "lobby.*" or "lobby.set" or "lobby.buildmode":
374 if arg-1 is set:
375 if arg-1 is "help":
376 send "&7──────────[ &d%{cmd}% &7]──────────"
377 send "<ttp:&7Get the %{cmd}% help page><cmd:/%{cmd}% help>&d/%{cmd}% help"
378 detectPermission(player, "lobby", "set", true, true, false, "&7Set the lobby location", "/%{cmd}% set", "", "&d/%{cmd}% set")
379 detectPermission(player, "lobby", "buildmode", true, false, true, "&7Enable/Disable buildmode", "", "/%{cmd}% buildmode enable/disable", "&d/%{cmd}% buildmode enable/disable")
380 send "&7──────────[ &d%{cmd}% &7]──────────"
381
382 else if arg-1 is "set":
383 if player has permission "lobby.*" or "lobby.set":
384 send "{@lobby} Succesfully set the &d%{cmd}% &fto your location!"
385 set {lobby.world} to "%world of player%"
386 set {lobby.location} to location of player
387 else:
388 send "{@lobby} You don't have enough permissions to do this!"
389
390 else if arg-1 is "buildmode":
391 if player has permission "lobby.*" or "lobby.set":
392 if world of player is {lobby.world}:
393 if arg-2 is set:
394 if arg-2 parsed as a player is set:
395 if {lobby.buildmode.%arg-2%} is true:
396 delete {lobby.buildmode.%arg-2%}
397 send "{@lobby} You have &ddisabled &fbuildmode for &d%name of arg-2 parsed as a player% &fin the &dlobby&f!"
398 send "{@lobby} Your buildmode has been &ddisabled &fin the &dlobby&f!" to arg-2 parsed as a player
399
400 else:
401 set {lobby.buildmode.%arg-2%} to true
402 send "{@lobby} You have &denabled &fbuildmode for &d%name of arg-2 parsed as a player% &fin the &dlobby&f!"
403 send "{@lobby} Your buildmode has been &denabled &fin the &dlobby&f!" to arg-2 parsed as a player
404 else:
405 send "{@lobby} &d%arg-2% &fis not online!"
406
407 else:
408 if {lobby.buildmode.%player%} is true:
409 delete {lobby.buildmode.%player%}
410 send "{@lobby} You have &ddisabled &fbuildmode for yourself in the &dlobby&f!"
411
412 else:
413 set {lobby.buildmode.%player%} to true
414 send "{@lobby} You have &denabled &fbuildmode for yourself in the &dlobby&f!"
415
416 else:
417 set {lobby.buildmode.%player%} to true
418 send "{@lobby} You have &denabled &fbuildmode for yourself in the &dlobby&f!"
419 else:
420 send "{@lobby} You don't have enough permissions to do this!"
421
422 else:
423 send "{@logo} You are &enot &fin the &elobby&f!"
424 else:
425 teleportLobby(player, world of player)
426 else:
427 teleportLobby(player, world of player)
428
429 else:
430 send "{@lobby} Only players can execute this command!"
431
432
433command /lobbycompass [<text>] [<text>] [<text>]:
434 aliases: /lcomp, /lcompass, /lobbycomp
435 trigger:
436 if player has permission "lobby.*" or "lobby.compass.*" or "lobby.compass.create" or "lobby.compass.delete" or "lobby.compass.setspawn" or "lobby.compass.setslot" or "lobby.compass.setname" or "lobby.compass.deletename" or "lobby.compass.setlore" or "lobby.compass.deletelore" or "lobby.compass.setitem" or "lobby.compass.deleteitem" or "lobby.compass.list" or "lobby.compass.setrows" or "lobby.compass.gui":
437 if arg-1 is not set:
438 send "{@lobby} Do &d/%{cmd}% help &ffor more info."
439
440 else if arg-1 is "help":
441 send "&7──────────[ &d%{cmd}% &7]──────────"
442 send "<ttp:&7Get the %{cmd}% help page><cmd:/%{cmd}% help>&d/%{cmd}% help"
443 detectPermission(player, "lobbyCompass", "create", true, false, true, "&7Add a minigame to the compass", "", "/%{cmd}% create <minigame>", "&d/%{cmd}% create <minigame>")
444 detectPermission(player, "lobbyCompass", "delete", true, false, true, "&7Remove a minigame from the compass", "", "/%{cmd}% delete <minigame>", "&d/%{cmd}% delete <minigame>")
445 detectPermission(player, "lobbyCompass", "setslot", true, false, true, "&7Set the GUI slot for a minigame", "", "/%{cmd}% setslot <minigame> <slot>", "&d/%{cmd}% setslot <minigame> <slot>")
446 detectPermission(player, "lobbyCompass", "setname", true, false, true, "&7Set the name for a minigame", "", "/%{cmd}% setname <minigame> <name>", "&d/%{cmd}% setname <minigame> <name>")
447 detectPermission(player, "lobbyCompass", "deletename", true, false, true, "&7Delete the name for a minigame", "", "/%{cmd}% deletename <minigame>", "&d/%{cmd}% deletename <minigame>")
448 detectPermission(player, "lobbyCompass", "setlore", true, false, true, "&7Set the lore for a minigame", "", "/%{cmd}% setlore <minigame> <lore>", "&d/%{cmd}% setlore <minigame> <lore>")
449 detectPermission(player, "lobbyCompass", "deletelore", true, false, true, "&7Delete the lore for a minigame", "", "/%{cmd}% deletelore <minigame>", "&d/%{cmd}% deletelore <minigame>")
450 detectPermission(player, "lobbyCompass", "setitem", true, false, true, "&7Set the item for a minigame", "", "/%{cmd}% setitem <minigame> <item>", "&d/%{cmd}% setitem <minigame> <item>")
451 detectPermission(player, "lobbyCompass", "deleteitem", true, false, true, "&7Delete the item for a minigame", "", "/%{cmd}% deleteitem <minigame>", "&d/%{cmd}% deleteitem <minigame>")
452 detectPermission(player, "lobbyCompass", "list", true, true, false, "&7Get a list from all minigames", "/%{cmd}% list", "", "&d/%{cmd}% list")
453 detectPermission(player, "lobbyCompass", "setrows", true, false, true, "&7Set the amount of rows in the GUI", "", "/%{cmd}% setrows <rows>", "&d/%{cmd}% setrows <rows>")
454 detectPermission(player, "lobbyCompass", "gui", true, false, true, "&7Open a easy-setup GUI for minigames", "", "/%{cmd}% gui <minigame>", "&d/%{cmd}% gui <minigame>")
455 send "&7──────────[ &d%{cmd}% &7]──────────"
456
457 else if arg-1 is "create":
458 if player has permission "lobby.*" or "lobby.compass.*" or "lobby.compass.create":
459 if arg-2 is set:
460 if {lobby.minigames.%arg-2%} is not set:
461 set {lobby.minigames.%arg-2%} to true
462 set {lobby.minigames.%arg-2%.name} to "&cNone"
463 set {lobby.minigames.%arg-2%.lore} to "&cNone"
464 set {lobby.minigames.%arg-2%.item} to "&cNone"
465 set {lobby.minigames.%arg-2%.slot} to "&cNone"
466 set {lobby.minigames.%arg-2%.spawn} to location of player
467 add arg-2 to {lobby.minigames.list::*}
468
469 send "{@lobby} Succesfully made the minigame &d%arg-2%&f!"
470
471 else:
472 send "{@lobby} The minigame &d%arg-2% &falready exists!"
473 else:
474 send "{@lobby} The command is not used correctly!" and "{@lobby} Correct usage: &d/%{cmd}% %arg-1% <minigame>&f."
475 else:
476 send "{@lobby} You don't have enough permissions to do this!"
477
478 else if arg-1 is "delete" or "remove":
479 if player has permission "lobby.*" or "lobby.compass.*" or "lobby.compass.delete":
480 if arg-2 is set:
481 if {lobby.minigames.%arg-2%} is set:
482 delete {lobby.minigames.%arg-2%}
483 delete {lobby.mninigames.%arg-2%.name}
484 delete {lobby.mninigames.%arg-2%.lore}
485 delete {lobby.mninigames.%arg-2%.item}
486 delete {lobby.mninigames.%arg-2%.slot}
487 delete {lobby.mninigames.%arg-2%.spawn}
488 remove arg-2 from {lobby.minigames.list::*}
489
490 send "{@lobby} Succesfully removed the minigame &d%arg-2%&f!"
491 else:
492 send "{@lobby} The minigame &d%arg-2% &fdoesn't exist!"
493 else:
494 send "{@lobby} The command is not used correctly!" and "{@lobby} Correct usage: &d/%{cmd}% %arg-1% <minigame>&f."
495 else:
496 send "{@lobby} You don't have enough permissions to do this!"
497
498 else if arg-1 is "setspawn":
499 if player has permission "lobby.*" or "lobby.compass.*" or "lobby.compass.setspawn":
500 if arg-2 is set:
501 if {lobby.minigames.%arg-2%} is set:
502 set {lobby.minigames.%arg-2%.spawn} to location of player
503 send "{@lobby} Succesfully set the spawn of the minigame &d%arg-2% &fat &d%location of player%&f!"
504
505 else:
506 send "{@lobby} The minigame &d%arg-2% &fdoesn't exist!"
507 else:
508 send "{@lobby} The command is not used correctly!" and "{@lobby} Correct usage: &d/%{cmd}% %arg-1% <minigame>&f."
509 else:
510 send "{@lobby} You don't have enough permissions to do this!"
511
512 else if arg-1 is "setslot":
513 if player has permission "lobby.*" or "lobby.compass.*" or "lobby.compass.setslot":
514 if arg-2 is set:
515 if {lobby.minigames.%arg-2%} is set:
516 if arg-3 is set:
517 if (arg-3 parsed as a number) is set:
518 if {lobby.items.compass.rows} is not set:
519 set {lobby.items.compass.rows} to 1
520
521 else if {lobby.items.compass.rows} < 1:
522 set {lobby.items.compass.rows} to 1
523
524 if {lobby.items.compass.rows}*9-1 <= arg-3 parsed as a number:
525 send "{@lobby} The amount &d%arg-3% &fis to big! The slot number has to be between &d0 &fand &d%{lobby.items.compass.rows}*9-1%&f."
526
527 else:
528 loop {lobby.minigames.list::*}:
529 if {lobby.minigames.%loop-value%.slot} is arg-3:
530 set {_set} to loop-value
531 stop loop
532
533 if {_set} is set:
534 send "{@lobby} The slot &d%arg-3% &fis already in use by the minigame &d%{_set}%&f!"
535
536 else:
537 set {lobby.minigames.%arg-2%.slot} to arg-3 parsed as a number
538 send "{@lobby} Succesfully set the slot of the minigame &d%arg-2% &fto &d%arg-3%&f!"
539 else:
540 send "{@lobby} &d%arg-3% &fis not a number!"
541 else:
542 send "{@lobby} The command is not used correctly!" and "{@lobby} Correct usage: &d/%{cmd}% %arg-2% <slot>&f."
543 else:
544 send "{@lobby} The minigame &d%arg-2% &fdoesn't exist!"
545 else:
546 send "{@lobby} The command is not used correctly!" and "{@lobby} Correct usage: &d/%{cmd}% slot <minigame> <slot>&f."
547 else:
548 send "{@lobby} You don't have enough permissions to do this!"
549
550 else if arg-1 is "setname":
551 if player has permission "lobby.*" or "lobby.compass.*" or "lobby.compass.setname":
552 if arg-2 is set:
553 if {lobby.minigames.%arg-2%} is set:
554 if arg-3 is set:
555 set {lobby.minigames.%arg-2%.name} to "%arg-3%"
556 send "{@lobby} Succesfully set the name of the minigame &d%arg-2% &fto &d%arg-3%&f!"
557
558 else:
559 send "{@lobby} The command is not used correctly!" and "{@lobby} Correct usage: &d/%{cmd}% setname %arg-2% <name>&f."
560 else:
561 send "{@lobby} The minigame &d%arg-2% &fdoesn't exist!"
562 else:
563 send "{@lobby} The command is not used correctly!" and "{@lobby} Correct usage: &d/%{cmd}% setname <minigame> <name>&f."
564 else:
565 send "{@lobby} You don't have enough permissions to do this!"
566
567 else if arg-1 is "deletename" or "delname":
568 if player has permission "lobby.*" or "lobby.compass.*" or "lobby.compass.deletename":
569 if arg-2 is set:
570 if {lobby.minigames.%arg-2%} is set:
571 set {lobby.minigames.%arg-2%.name} to "&cNone"
572 send "{@lobby} Succesfully deleted the name of the minigame &d%arg-2%&f!"
573
574 else:
575 send "{@lobby} The minigame &d%arg-2% &fdoesn't exist!"
576 else:
577 send "{@lobby} The command is not used correctly!" and "{@lobby} Correct usage: &d/%{cmd}% %arg-1 in lower case% <minigame>&f."
578
579 else:
580 send "{@lobby} You don't have enough permissions to do this!"
581
582
583 else if arg-1 is "setlore":
584 if player has permission "lobby.*" or "lobby.compass.*" or "lobby.compass.setlore":
585 if arg-2 is set:
586 if {lobby.minigames.%arg-2%} is set:
587 if arg-3 is set:
588 set {lobby.minigames.%arg-2%.lore} to "%arg-3%"
589 send "{@lobby} Succesfully set the lore of the minigame &d%arg-2% &fto &d%arg-3%&f!"
590
591 else:
592 send "{@lobby} The command is not used correctly!" and "{@lobby} Currect usage: &d/%{cmd}% setlore %arg-2% <lore>&f."
593 else:
594 send "{@logo} The minigame &d%arg-2% &fdoesn't exist!"
595 else:
596 send "{@logo} The command is not used correctly!" and "{@lobby} Correct usage: &d/%{cmd}% setlore <minigame> <lore>&f."
597
598 else:
599 send "{@lobby} You don't have enough permissions to do this!"
600
601 else if arg-1 is "deletelore" or "dellore":
602 if player has permission "lobby.*" or "lobby.compass.*" or "lobby.compass.deletelore":
603 if arg-2 is set:
604 if {lobby.minigames.%arg-2%} is set:
605 set {lobby.minigames.%arg-2%.lore} to "&cNone"
606 send "{@lobby} Succesfully deleted the lore of the minigame &d%arg-2%&f!"
607
608 else:
609 send "{@lobby} The minigame &d%arg-2% &fdoesn't exist!"
610 else:
611 send "{@lobby} The command is not used correctly!" and "{@lobby} Correct usage: &d/%{cmd}% %arg-1 in lower case% <minigame>&f."
612
613 else:
614 send "{@lobby} You don't have enough permissions to do this!"
615
616
617 else if arg-1 is "setitem":
618 if player has permission "lobby.*" or "lobby.compass.*" or "lobby.compass.setitem":
619 if arg-2 is set:
620 if {lobby.minigames.%arg-2%} is set:
621 if arg-3 is set:
622 if arg-3 parsed as an item is set:
623 set {lobby.minigames.%arg-2%.item} to arg-3 parsed as an item type
624 send "{@lobby} Succesfully set the item of the minigame &d%arg-2% &fto &d%arg-3%&f!"
625
626 else:
627 send "{@lobby} &d%arg-3% &fis not an item!"
628 else:
629 send "{@lobby} The command is not used correctly!" and "{@lobby} Correct usage: &d/%{cmd}% setitem %arg-2% <item>&f."
630 else:
631 send "{@lobby} The minigame &d%arg-2% &fdoesn't exist!"
632 else:
633 send "{@lobby} The command is not used correctly!" and "{@lobby} Correct usage: &d/%{cmd}% setitem <minigame> <item>&f."
634 else:
635 send "{@lobby} You don't have enough permissions to do this!"
636
637 else if arg-1 is "deleteitem" or "delitem":
638 if player has permission "lobby.*" or "lobby.compass.*" or "lobby.compass.deleteitem":
639 if arg-2 is set:
640 if {lobby.minigames.%arg-2%} is set:
641 set {lobby.minigames.%arg-2%.item} to "&cNone"
642 send "{@lobby} Succesfully deleted the item of the minigame &d%arg-2%&f!"
643
644 else:
645 send "{@lobby} The minigame &d%arg-2% &fdoesn't exist!"
646 else:
647 send "{@lobby} The command is not used correctly!" and "{@lobby} Correct usage: &d/%{cmd}% %arg-1 in lower case% <minigame>&f."
648
649 else:
650 send "{@lobby} You don't have enough permissions to do this!"
651
652
653 else if arg-1 is "list":
654 if player has permission "lobby.*" or "lobby.compass.*" or "lobby.compass.list":
655 if {lobby.minigames.list::*} is not empty:
656 loop {lobby.minigames.list::*}:
657 if {_list} is set:
658 set {_list} to "%{_list}%&f, &d%loop-value%"
659 else:
660 set {_list} to "%loop-value%"
661
662 send "{@lobby} This is the list of all the minigames:" and "&d%{_list}%"
663 else:
664 send "{@lobby} There are no minigames added yet."
665 else:
666 send "{@lobby} You don't have enough permissions to do this!"
667
668
669 else if arg-1 is "setrows":
670 if player has permission "lobby.*" or "lobby.compass.*" or "lobby.compass.setrows":
671 if arg-2 is set:
672 if arg-2 parsed as a number is set:
673 if arg-2 parsed as a number < 7:
674 set {lobby.items.compass.rows} to arg-2 parsed as a number
675 set yml value "Lobby.Join.Compass.GUI.rows" of file "{@config}" to arg-2 parsed as a number
676 send "{@lobby} Succesfully set the amount of rows to &d%arg-2%&f!"
677
678 else:
679 send "{@lobby} The maximum amount of rows is &d6&f!"
680 else:
681 send "{@lobby} &d%arg-2% &fis not a number!"
682 else:
683 send "{@lobby} The command is not used correctly!" and "{@logo} Correct usage: &d/%{cmd}% setrows <rows>&f."
684 else:
685 send "{@lobby} You don't have enough permissions to do this!"
686
687 else if arg-1 is "gui":
688 if player has permission "lobby.*" or "lobby.compass.*" or "lobby.compass.gui":
689 if arg-2 is set:
690 if {lobby.minigames.%arg-2%} is set:
691 wait 2 ticks
692 open chest with 2 rows named "&8Config GUI" to player
693 wait 2 ticks
694 set {_item} to "book"
695 set {_name} to {lobby.minigames.%arg-2%.name}
696 set {_lore} to {lobby.minigames.%arg-2%.lore}
697
698 replace all "&" in {_name} with "§"
699 replace all "&" in {_lore} with "§"
700
701 if ({lobby.minigames.%arg-2%.item} parsed as an item type) is set:
702 if ({lobby.minigames.%arg-2%.item} parsed as an item type) is not air:
703 set {_item} to {lobby.minigames.%arg-2%.item}
704
705 format slot 2 of player with ({_item} parsed as an item type) named "&fMinigame: &d%arg-2%" to be unstealable
706 format slot 3 of player with name tag named "&fName: &d%{_name}%" to close then run [createCompassGUI(player, "&8Name %arg-2%", 3, 12, 14, green_wool, red_wool, "&aChange", "&cDeny", "{@lobby} Click <sgt:/lcomp setname %arg-2% [naam]>&dhere&f to edit the name.", "{@lobby} You have chosen to give the minigame &d%arg-2% &fnot an other name.", false)]
707 format slot 4 of player with paper named "&fLore" with lore {_lore} to close then run [createCompassGUI(player, "&8Lore %arg-2%", 3, 12, 14, green_wool, red_wool, "&aChange", "&cDeny", "{@lobby} Click <sgt:/lcomp setlore %arg-2% [lore]>&dhere&f to edit the lore.", "{@lobby} You have chosen to give the minigame &d%arg-2% &fnot an other lore.", false)]
708 format slot 5 of player with ({_item} parsed as an item type) named "&fItem: &d%{lobby.minigames.%arg-2%.item}%" to close then run [createCompassGUI(player, "&8Item %arg-2%", 3, 12, 14, green_wool, red_wool, "&aChange", "&cDeny", "{@lobby} Click <sgt:/lcompass setitem %arg-2% [item]>&dhere&f to edit the item.", "{@lobby} You have chosen to give the minigame &d%arg-2% &fnot an other item.", false)]
709 format slot 6 of player with clock named "&fSlot: &d%{lobby.minigames.%arg-2%.slot}%" to close then run [createCompassGUI(player, "&8Slot %arg-2%", 3, 12, 14, green_wool, red_wool, "&aChange", "&cDeny", "{@lobby} Click <sgt:/lcompass setslot %arg-2% [slot]>&dhere&f to edit the slot.", "{@lobby} You have chosen to give the minigame &d%arg-2% &fnot an other slot.", false)]
710
711 format slot 12 of player with redstone torch on named "&fSpawn: &d%{lobby.minigames.%arg-2%.spawn}%" to close then run [createCompassGUI(player, "&8Spawn %arg-2%", 3, 12, 14, green_wool, red_wool, "&aSet", "&cDeny", "{@lobby} Click <cmd:/lcompass setspawn %arg-2%>&dhere&f to set the spawn.", "{@lobby} You have chosen to give the minigame &d%arg-2% &fnot an other spawn.", false)]
712 format slot 13 of player with barrier named "&cClose menu" to close
713 format slot 14 of player with redstone named "&4Delete" to close then run [createCompassGUI(player, "&8Delete %arg-2%", 3, 12, 14, green_wool, red_wool, "&aDelete", "&cDeny", "/lcompass delete %arg-2%", "{@lobby} &fYou have chosen to not delete the minigame &d%arg-2%&f.", true)]
714
715 else:
716 send "{@lobby} The minigame &d%arg-2% &fdoesn't exist!"
717 else:
718 send "{@lobby} The command is not used correctly!" and "{@lobby} Correct usage: &d/%{cmd}% gui <minigame>&f."
719
720 else:
721 send "{@lobby} You don't have enough permissions to do this!"
722
723 else:
724 send "{@lobby} Do &d/%{cmd}% help &ffor more info."
725
726
727#-----------------------------------{ Other }-----------------------------------
728function sendPluginList(p: Player):
729 set {_list::*} to list of plugins
730 set {_count} to 0
731 loop {_list::*}:
732 add 1 to {_count}
733 if {_list} is set:
734 set {_list} to "%{_list}%&f, &e%loop-value%"
735 else:
736 set {_list} to "&e%loop-value%"
737
738 send "{@logo} Total Plugins: &6%{_count}%%nl%&e%{_list}%" to {_p}
739
740
741on command:
742 command ends with "plugins":
743 cancel event
744 if player has permission "op":
745 sendPluginList(player)
746
747 command ends with "pl":
748 cancel event
749 if player has permission "op":
750 sendPluginList(player)
751
752 else:
753 set {cmd} to "%command in lower case%"
754
755
756#-----------------------------------{ Remove - Temporarily }-----------------------------------
757command /palette:
758 trigger:
759 send "{@logo} Server Text Palette &earcated"
760 send "{@lobby} Lobby Text Palette &darcated"