Zeldaboy111

Skript #263 ]|[ Crate (3)

Nov 18th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 46.35 KB | None | 0 0
  1. #© This Skript reselling/reuploading and claiming as it is yours is not allowed! ©
  2. #© Using this Skript in a video is no problem, only mention the things below this ©
  3. #
  4. #Skript made by Zeldaboy111
  5. #YouTube creator: https://www.youtube.com/channel/UClmeX0PpxrQd9q-4kRaBefg?view_as=subscriber
  6. #More content of the creator: https://forums.skunity.com/search/26443679/
  7.  
  8.  
  9. options:
  10. logo: &6Server &7▬ &2
  11. lobby: &cLobby &7► &2
  12. lcompass: &9C&3ompass
  13. cGuiName: &9M&3inigames
  14. path: Files/Lobby
  15. config: Files/Lobby/config.yml
  16.  
  17.  
  18. #alt + 15 = ☼
  19. #alt + 26 = →
  20. #alt + 16 = ►
  21. #alt + 22 = ▬
  22.  
  23. #------------------- Functions -------------------
  24. function contains(list: objects, check: object) :: boolean:
  25. loop {_list::*}:
  26. if loop-value is {_check}:
  27. return true
  28. return false
  29.  
  30. function openCompass(p: Player):
  31. if {lobby.compassRows} is not set:
  32. set {lobby.compassRows} to 1
  33.  
  34. open chest with {lobby.compassRows} rows named "{@cGuiName}" to {_p}
  35.  
  36. loop {lobby.minigames.list::*}:
  37. if {lobby.minigames.%loop-value%.slot} starts with "-":
  38. stop
  39. else:
  40. if ({lobby.minigames.%loop-value%.slot} parsed as a number) is set:
  41.  
  42. if {lobby.minigames.%loop-value%.item} is "&cNone":
  43. set {_item} to paper
  44.  
  45. else if ({lobby.minigames.%loop-value%.item} parsed as an item) is not set:
  46. set {_item} to paper
  47.  
  48. else:
  49. set {_item} to {lobby.minigames.%loop-value%.item}
  50.  
  51.  
  52. set {_slot} to ({lobby.minigames.%loop-value%.slot} parsed as a number)
  53.  
  54. if {lobby.minigames.%loop-value%.name} is set:
  55. if {lobby.minigames.%loop-value%.name} is not "&cNone":
  56. set {_name} to {lobby.minigames.%loop-value%.name}
  57. replace "&" in {_name} with "§"
  58. if {lobby.minigames.%loop-value%.lore} is set:
  59. if {lobby.minigames.%loop-value%.lore} is not "&cNone":
  60. set {_lore} to {lobby.minigames.%loop-value%.lore}
  61. replace "&" in {_lore} with "§"
  62. format gui slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item named "%{_name}%" with lore "%{_lore}%" to do nothing
  63. else:
  64. format gui slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item named "%{_name}%" to do nothing
  65. else:
  66. format gui slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item named "%{_name}%" to do nothing
  67. else:
  68. format gui slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item to do nothing
  69. else:
  70. format gui slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item to do nothing
  71.  
  72.  
  73. function changeName(p: Player, s: String):
  74. open chest with 3 rows named "&4Name &c%{_s}%" to {_p}
  75.  
  76. format gui slot 12 of {_p} with green_wool named "&aChange" to run:
  77. close {_p}'s inventory
  78. send "{@lobby} &2Click <suggest command:/lcompass setname %{_s}% [naam]>&ahere<reset> &2to edit the name." to {_p}
  79.  
  80.  
  81. format gui slot 14 of {_p} with red_wool named "&cDeny" to run:
  82. close {_p}'s inventory
  83. send "{@lobby} &4You have chosen to give the minigame%nl%&c%{_s}% &4not an other name." to {_p}
  84.  
  85. function changeLore(p: Player, s: String):
  86. open chest with 3 rows named "&4Lore &c%{_s}%" to {_p}
  87.  
  88. format gui slot 12 of {_p} with green_wool named "&aChange" to run:
  89. close {_p}'s inventory
  90. send "{@lobby} &2Click <suggest command:/lcompass setlore %{_s}% [lore]>&ahere<reset> &2to edit the lore." to {_p}
  91.  
  92. format gui slot 14 of {_p} with red_wool named "&cDeny" to run:
  93. close {_p}'s inventory
  94. send "{@lobby} &4You have chosen to give the minigame%nl%&c%{_s}% &4not an other lore." to {_p}
  95.  
  96. function changeItem(p: Player, s: String):
  97. open chest with 3 rows named "&4Item &c%{_s}%" to {_p}
  98.  
  99. format gui slot 12 of {_p} with green_wool named "&aChange" to run:
  100. close {_p}'s inventory
  101. send "{@lobby} &2Click <suggest command:/lcompass setitem %{_s}% [item]>&ahere<reset> &2to edit the item." to {_p}
  102.  
  103. format gui slot 14 of {_p} with red_wool named "&cDeny" to run:
  104. close {_p}'s inventory
  105. send "{@lobby} &4You have chosen to give the minigame%nl%&c%{_s}% &4not an other item." to {_p}
  106.  
  107. function setSlot(p: Player, s: String):
  108. open chest with 3 rows named "&4Slot &c%{_s}%" to {_p}
  109.  
  110. format gui slot 12 of {_p} with green_wool named "&aChange" to run:
  111. close {_p}'s inventory
  112. send "{@lobby} &2Click <suggest command:/lcompass slot %{_s}% [slot]>&ahere<reset> &2to edit the slot." to {_p}
  113.  
  114. format gui slot 14 of {_p} with red_wool named "&cDeny" to run:
  115. close {_p}'s inventory
  116. send "{@lobby} &4You have chosen to give the minigame%nl%&c%{_s}% &4not an other slot." to {_p}
  117.  
  118.  
  119. function setSpawn(p: Player, s: String):
  120. open chest with 3 rows named "&4Spawn &c%{_s}%" to {_p}
  121.  
  122. format gui slot 12 of {_p} with green_wool named "&aSet spawn" to run:
  123. close {_p}'s inventory
  124. send "{@lobby} &2Click <command:/lcompass setspawn %{_s}%>&ahere<reset> &2to set the spawn." to {_p}
  125.  
  126. format gui slot 14 of {_p} with red_wool named "&cDeny" to run:
  127. close {_p}'s inventory
  128. send "{@lobby} &4You have chosen to give the minigame%nl%&c%{_s}% &4not an other spawn." to {_p}
  129.  
  130.  
  131. function deleteMinigame(p: Player, s: String):
  132. open chest with 3 rows named "&4Delete &c%{_s}%" to {_p}
  133.  
  134. format gui slot 12 of {_p} with green_wool named "&aAccept" to run:
  135. close {_p}'s inventory
  136. execute player command "/lcompass delete %{_s}%"
  137.  
  138. format gui slot 14 of {_p} with red_wool named "&cDeny" to run:
  139. close {_p}'s inventory
  140. send "{@lobby} &4Je hebt ervoor gekozen om de minigame%nl%&c%{_s}% &4niet te verwijderen." to {_p}
  141.  
  142. function animation1(p: Player, count: Integer, count2: Integer) :: boolean:
  143.  
  144. loop 9 times:
  145. if {crates.reopening.%{_p}%} is true:
  146. delete {crates.reopening.%{_p}%}
  147. clear {crate.%{_p}%.inv::*}
  148. clear {crate.%{_p}%.name}
  149. send "True" to console
  150.  
  151. if {crates.closed.%{_p}%} is true:
  152. if {_count} = {_count2}-18:
  153. set {crate.%{_p}%.inv::%{_count}%} to "light green glass"
  154. set {crate.%{_p}%.inv::%{_count2}%} to "light green glass"
  155. else:
  156. set {crate.%{_p}%.inv::%{_count}%} to "gray glass"
  157. set {crate.%{_p}%.inv::%{_count2}%} to "gray glass"
  158.  
  159. else:
  160. if {_count} = {_count2}-18:
  161. format gui slot {_count} of {_p} with light green stained glass pane to do nothing
  162. format gui slot {_count2} of {_p} with light green stained glass pane to do nothing
  163.  
  164. else:
  165. format gui slot {_count} of {_p} with gray stained glass pane to do nothing
  166. format gui slot {_count2} of {_p} with gray stained glass pane to do nothing
  167.  
  168. add 1 to {_count}
  169. remove 1 from {_count2}
  170. wait 5 ticks
  171. #return false
  172.  
  173. set {opening.%{_p}%} to true
  174. #return true
  175.  
  176.  
  177. function openCrate(p: Player, crate: String):
  178. if {keys.%{_p}%.%{_crate}%} > 0:
  179. open chest with 3 rows named "&2%{_crate}%" to {_p}
  180.  
  181. set {crates.opening.%{_p}%} to true
  182. set {_count} to 0
  183. set {_count2} to 26
  184. set {opening.%{_p}%} to false
  185.  
  186. #Animations
  187. set {opening.%{_p}%} to animation1({_p}, {_count}, {_count2})
  188.  
  189.  
  190. while {opening.%{_p}%} is false:
  191. wait 1 tick
  192.  
  193.  
  194.  
  195. delete {opening.%{_p}%}
  196. set {_rewards::*} to yml list "Item.List" of file "{@path}/%{_crate}%.yml"
  197. set {_rewardsNames::*} to yml list "Item.ConfigName" of file "{@path}/%{_crate}%.yml"
  198. set {_count} to 1
  199. loop {_rewards::*}:
  200. if loop-value parsed as an item is not set:
  201. remove loop-value from {_rewards::*}
  202. send "%nl%{@lobby} &4ERROR! &c%loop-value% &4is an item ID or not a valid item!%nl%" to console
  203.  
  204. else:
  205. set {_item} to loop-value parsed as an item
  206. set {_name} to {_rewardsNames::%{_count}%}
  207. if {_name} is set:
  208. delete {_rewards::%{_count}%}
  209.  
  210. if yml value "Item.Name.%{_name}%" of file "{@path}/%{_crate}%.yml" is set:
  211. set {_itemName} to yml value "Item.Name.%{_name}%" of file "{@path}/%{_crate}%.yml" parsed as a string
  212. set name of {_item} to "&f%{_itemName}%"
  213.  
  214. if yml value "Item.Amount.%{_name}%" of file "{@path}/%{_crate}%.yml" is set:
  215. set {_itemAmount} to yml value "Item.Amount.%{_name}%" of file "{@path}/%{_crate}%.yml"
  216. set {_itemAmount} to ({_itemAmount} parsed as a number)
  217. if {_itemAmount} is set:
  218. set {_amount} to {_itemAmount}
  219. else:
  220. set {_amount} to 1
  221. send "%nl%{@lobby} &c%{_itemAmount}% &4is not a number!%nl%" to console
  222. else:
  223. set {_amount} to 1
  224.  
  225. set {_item} to ("%{_amount}% %{_item}%" parsed as an item)
  226.  
  227. if yml value "Item.Lore.%{_name}%" of file "{@path}/%{_crate}%.yml" is set:
  228. set {_s::*} to yml list "Item.Lore.%{_name}%" of file "{@path}/%{_crate}%.yml"
  229. delete {_s}
  230. loop {_s::*}:
  231. if {_s} is not set:
  232. set {_s} to "%loop-value-2%"
  233. else:
  234. set {_s} to "%{_s}%||%loop-value-2%"
  235. set lore of {_item} to {_s}
  236.  
  237. if yml value "Item.Enchants.%{_name}%" of file "{@path}/%{_crate}%.yml" is set:
  238. set {_s::*} to yml list "Item.Enchants.%{_name}%" of file "{@path}/%{_crate}%.yml"
  239. loop {_s::*}:
  240. set {_value} to "%loop-value-2%"
  241. set {_split::*} to {_value} split at ""
  242.  
  243. if contains({_split::*}, ":") is true:
  244. set {_sSplit::*} to {_value} split at ":"
  245. set {_s1} to {_sSplit::1}
  246. set {_s2} to {_sSplit::2}
  247.  
  248. if ({_s1} parsed as an enchantment) is set:
  249. if ({_s2} parsed as a number) is set:
  250. enchant {_item} with "%{_s1}% %{_s2}%" parsed as an enchantment type
  251. set name of {_item} to "&b%{_itemName}%"
  252. else:
  253. send "%nl%{@lobby} &c%{_s2}% &4is not a number!%nl%" to console
  254. else:
  255. send "%nl%{@lobby} &c%{_s1}% &4is not an enchantment type!%nl%" to console
  256.  
  257. else:
  258. if (loop-value-2 parsed as an enchantment) is set:
  259. enchant {_item} with "%loop-value-2% 1" parsed as an enchantment type
  260.  
  261. else:
  262. send "%nl%{@lobby} &c%loop-value-2% &4is not an enchantment type!%nl%" to console
  263.  
  264.  
  265.  
  266. if yml value "Item.Chance.%{_name}%" of file "{@path}/%{_crate}%.yml" is set:
  267. set {_s} to yml value "Item.Chance.%{_name}%" of file "{@path}/%{_crate}%.yml" parsed as a string
  268. if ({_s} parsed as a number) is set:
  269. loop ({_s} parsed as a number) times:
  270. add {_item} to {_rewards::*}
  271.  
  272. else:
  273. send "%nl%{@lobby} &c%{_s}% &4is not a number!%nl%" to console
  274.  
  275. add 1 to {_count}
  276.  
  277. set {_random} to a random element out of {_rewards::*}
  278.  
  279. format gui slot 13 of {_p} with {_random} to do nothing
  280. play sound "entity.experience_orb.pickup" with volume 10 and pitch 5 at {_p} for all players
  281. delete {crates.closed.%{_p}%}
  282. remove {_p} from {crates.openinglist::*}
  283. delete {crate.%{_p}%.inv::*}
  284. delete {crate.%{_p}%.name}
  285. delete {crates.opening.%{_p}%}
  286. give {_p} {_random}
  287. remove 1 from {keys.%{_p}%.%{_crate}%}
  288.  
  289. #loop {_rewardsNames::*}:
  290. set {_number} to 1
  291. loop {_rewards::*}:
  292. if loop-value is {_random}:
  293. set {_rewName} to {_rewardsNames::%{_number}%}
  294. delete {_s}
  295. if yml value "Item.Name.%{_rewName}%" of file "{@path}/%{_crate}%.yml" is set:
  296.  
  297. set {_s} to yml value "Item.Name.%{_rewName}%" of file "{@path}/%{_crate}%.yml" parsed as a string
  298. replace all "[" in {_s} with ""
  299. replace all "]" in {_s} with ""
  300. else:
  301. set {_s} to {_random} parsed as an item type
  302. replace all "_" in {_s} with " "
  303. send "{@lobby} You've won &a%{_s}%&2!" to {_p}
  304. stop loop
  305.  
  306. add 1 to {_number}
  307.  
  308. else:
  309. send "{@lobby} &4You don't have anough keys to do this!" to {_p}
  310. play sound "entity.item.break" with volume 10 and pitch 1 at {_p} for {_p}
  311.  
  312. #------------------- Periotic Events -------------------
  313.  
  314.  
  315.  
  316.  
  317.  
  318. #------------------- Events -------------------
  319. on enable:
  320. if file "{@config}" doesn't exist:
  321. create file "{@config}"
  322.  
  323. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  324.  
  325. loop {_list::*}:
  326. if yml value "Locations" of file "{@path}/%loop-value%.yml" exists:
  327. set {_list2::*} to yml list "Locations" of file "{@path}/%loop-value%.yml"
  328. loop {_list2::*}:
  329. set {_loc} to loop-value-2
  330. set {_world} to world of {lobby.location}
  331.  
  332. set {holo-crate-%{_world}%-%{_loc}%} to new hologram at location above {_loc}
  333. unregister hologram {holo-crate-%{_world}%-%{_loc}%}
  334. delete {holo-crate-%{_world}%-%{_loc}%}
  335.  
  336. set {holo-crate-%{_world}%-%{_loc}%} to new hologram at location above {_loc}
  337. add text "&a&l%loop-value-1%" to hologram {holo-crate-%{_world}%-%{_loc}%}
  338.  
  339. on disable:
  340. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  341.  
  342. loop {_list::*}:
  343. delete yml list "Locations" of file "{@path}/%loop-value%.yml"
  344. loop {lobbycr.%loop-value-1%.location::*}:
  345. add "%loop-value-2%" to yml list "Locations" of file "{@path}/%loop-value-1%.yml"
  346. loop {crates.openinglist::*}:
  347. clear {crates.opening.%loop-value%}
  348. clear {crates.%loop-value%.inv::*}
  349. clear {crates.%loop-value%.name}
  350. clear {crate.closed.%loop-value%}
  351.  
  352. clear {crates.openinglist::*}
  353.  
  354. on join:
  355. if {lobby.location} is set:
  356. teleport player to {lobby.location}
  357. set join message to ""
  358. wait 10 ticks
  359.  
  360. clear player's inventory
  361. send "{@lobby} &fThe player %player% has joined!" to all players in world of player
  362. set slot 4 of player to a compass named "{@lcompass}"
  363.  
  364. on quit:
  365. if {crates.opening.%player%} is set:
  366. clear {crates.opening.%player%}
  367. clear {crates.%player%.inv::*}
  368. clear {crates.%player%.name}
  369. clear {crates.closed.%player%}
  370. remove player from {crates.openinglist::*}
  371.  
  372.  
  373. on inventory click:
  374. if player is in world of {lobby.location}:
  375. if clicked item is a compass named "{@lcompass}":
  376. cancel event
  377. close player's inventory
  378. openCompass(player)
  379.  
  380. on click:
  381. if player is in world of {lobby.location}:
  382. if player's held item is a compass named "{@lcompass}":
  383. cancel event
  384. openCompass(player)
  385.  
  386.  
  387. on command:
  388. command is "plugins" or "pl":
  389. cancel event
  390.  
  391. if player is not op:
  392. stop
  393.  
  394. else:
  395. set {_list::*} to list of plugins
  396. set {_count} to 0
  397. loop {_list::*}:
  398. add 1 to {_count}
  399. send "{@logo} Plugin list:%nl%&f(&a%{_count}%&f) &2%list of plugins%"
  400.  
  401. else:
  402. set {cmd} to "%command to lower case%"
  403.  
  404. on place of chest:
  405. set {_world} to world of event-block
  406. if {_world} is world of {lobby.location}:
  407. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  408. if contains({_list::*}, "%uncolored name of player's tool%"):
  409.  
  410. add location of event-block to {lobbycr.%uncolored name of player's tool%.location::*}
  411. add world of event-block to {lobbycr.%uncolored name of player's tool%.world::*}
  412. send "{@lobby} &2Succesfully created a &a%uncolored name of player's tool% &2Crate!"
  413.  
  414. set {holo-crate-%world of event-block%-%location of event-block%} to new hologram at location above event-block
  415. add text "&a&l%uncolored name of player's tool%" to hologram {holo-crate-%world of event-block%-%location of event-block%}
  416. add "%location of event-block%" to yml list "Locations" of file "{@path}/%uncolored name of player's tool%.yml"
  417.  
  418. on break of chest:
  419. set {_world} to world of event-block
  420. if {_world} is world of {lobby.location}:
  421. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  422. loop {_list::*}:
  423. loop {lobbycr.%loop-value-1%.location::*}:
  424. if loop-value-2 is location of event-block:
  425. unregister hologram {holo-crate-%world of event-block%-%location of event-block%}
  426.  
  427. remove location of event-block from {lobbycr.%loop-value-1%.location::*}
  428. remove world of event-block from {lobbycr.%loop-value-1%.world::*}
  429.  
  430.  
  431. delete {holo-crate-%world of event-block%-%location of event-block%}
  432. remove "%location of event-block%" from yml list "Locations" of file "{@path}/%loop-value-1%.yml"
  433.  
  434. send "{@lobby} &2Succesfully removed a &a%loop-value-1% &2Crate!"
  435.  
  436.  
  437.  
  438. on rightclick on a chest:
  439. set {_world} to world of clicked block
  440. if {_world} is "%world of {lobby.location}%":
  441.  
  442. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  443. loop {_list::*}:
  444.  
  445. loop {lobbycr.%loop-value-1%.location::*}:
  446. if "%loop-value-2%" is "%location of clicked block%":
  447. cancel event
  448. if "%uncolored {crate.%player%.name}%" = loop-value-1:
  449. if {crates.opening.%player%} is true:
  450. open chest with 3 rows named "&2%{crate.%player%.name}%" to player
  451.  
  452. set {crates.reopening.%player%} to true
  453. set {_count} to 0
  454. loop 27 times:
  455. if {crate.%player%.inv::%{_count}%} is set:
  456. set {_value} to "%{crate.%player%.inv::%{_count}%}%"
  457. set {_color::*} to {_value} split at " "
  458.  
  459. if contains({_color::*}, "glass") is true:
  460. if contains({_color::*}, "light") is true:
  461. format gui slot {_count} of player with ("light %{_color::2}% stained glass pane" parsed as an item) to do nothing
  462.  
  463. else if contains({_color::*}, "dark") is true:
  464. format gui slot {_count} of player with ("dark %{_color::2}% stained glass pane" parsed as an item) to do nothing
  465.  
  466. else:
  467. format gui slot {_count} of player with ("%{_color::1}% stained glass pane" parsed as an item) to do nothing
  468.  
  469. else:
  470. format gui slot {_count} of player with ({crate.%player%.inv::%{_count}%} parsed as an item) to do nothing
  471.  
  472.  
  473. add 1 to {_count}
  474.  
  475. delete {crates.closed.%player%}
  476. delete {crates.openinglist::*}
  477. delete {crate.%player%.inv::*}
  478. delete {crate.%player%.name}
  479.  
  480.  
  481. else:
  482. open chest with 3 rows named "&2%loop-value-1%" to player
  483. format gui slot 13 of player with a tripwire hook named "&7Open crate" to close then run function openCrate(player, "%loop-value-1%")
  484. stop loop
  485.  
  486.  
  487. on inventory close:
  488. if {crates.opening.%player%} is true:
  489. set {crates.closed.%player%} to true
  490. add player to {crates.openinglist::*}
  491. clear {crate.%player%.inv::*}
  492. set {crate.%player%.name} to name of player's current inventory
  493. set {_count} to 0
  494.  
  495.  
  496. loop 27 times:
  497. set {crate.%player%.inv::%{_count}%} to slot {_count} of player's current inventory
  498. add 1 to {_count}
  499.  
  500. else if {crates.opening.%player%} is set:
  501. delete {crates.opening.%player%}
  502.  
  503. on chat:
  504. if world of player is world of {lobby.location}:
  505. cancel event
  506. send "&7[&e%player%&7] &8>> &f%message%" to all players in world of player
  507. send "&7[&eLobby&7][&e%player%&7] &f>> %message%" to console
  508.  
  509. #------------------- Commands -------------------
  510. command /lobby [<text>] [<text>]:
  511. aliases: /hub
  512. trigger:
  513. if player has permission "lobby.*":
  514. if arg-1 is set:
  515. if arg-1 is "help":
  516. send "&2----------[ &a%{cmd}% &2]----------"
  517. send "&e&o/%{cmd}% help &d→ &fGet the help page"
  518. send "&e&o/%{cmd}% set &d→ &fSet the lobby"
  519. send "&2----------[ &a%{cmd}% &2]----------"
  520.  
  521. else if arg-1 is "set":
  522. send "{@logo} &2Succesfully set the &a%{cmd}% &2to your location!"
  523. set {lobby.location} to location of player
  524.  
  525. else:
  526. if {lobby.location} is set:
  527. if world of player is not "%world of {lobby.location}%":
  528. teleport player to {lobby.location}
  529. send "{@lobby} &fThe player %player% went to the lobby!" to all players in world of player
  530. clear player's inventory
  531. set slot 4 of player to a compass named "{@lcompass}"
  532.  
  533. else:
  534. teleport player to {lobby.location}
  535.  
  536.  
  537. else:
  538. send "{@lobby} &cThe %{cmd}% is not set yet!"
  539.  
  540.  
  541. else if {lobby.location} is set:
  542. if world of player is not "%world of {lobby.location}%":
  543. teleport player to {lobby.location}
  544. send "{@lobby} &fThe player %player% went to the lobby!" to all players in world of player
  545. clear player's inventory
  546. set slot 4 of player to a compass named "{@lcompass}"
  547.  
  548. else:
  549. teleport player to {lobby.location}
  550.  
  551. else:
  552. send "{@lobby} &cThe %{cmd}% is not set yet!"
  553.  
  554.  
  555. command /lobbycompass [<text>] [<text>] [<text>]:
  556. aliases: /lcomp, /lcompass
  557. trigger:
  558. if player has permission "lobbycompass.*":
  559. if arg 1 is not set:
  560. send "{@lobby} &4Do &c&o/%{cmd}% help &4for more info."
  561.  
  562. else if arg 1 is set:
  563. if arg 1 is "help":
  564. send "&2----------[ &a%{cmd}% &2]----------"
  565. send "&e&o/%{cmd}% help &d→ &fKrijg help pagina"
  566. send "&e&o/%{cmd}% create <minigame> &d→ &fCreate a minigame"
  567. send "&e&o/%{cmd}% remove/delete <minigame> &d→ &fDelete a minigame"
  568. send "&e&o/%{cmd}% setspawn <minigame> &d→ &fSet the spawn of a minigame"
  569. send "&e&o/%{cmd}% slot <minigame> <number> &d→ &fSet the GUI slot of a minigame"
  570.  
  571. send "&e&o/%{cmd}% setname <minigame> <name> &d→ &fSet a name"
  572. send "&e&o/%{cmd}% deletename <minigame> &d→ &fDelete the name of a minigame"
  573. send "&e&o/%{cmd}% setlore <minigame> <lore> &d→ &fSet a lore"
  574. send "&e&o/%{cmd}% deletelore <minigame> <minigame> &d→ &fDelete the lore of a minigame"
  575. send "&e&o/%{cmd}% setitem <minigame> <item> &d→ &fSet the item of a minigame"
  576. send "&e&o/%{cmd}% list &d→ &fGet a list of all the minigames"
  577. send "&e&o/%{cmd}% setrows <number> &d→ &fSet the amount of rows in the GUI"
  578. send "&e&o/%{cmd}% gui <minigame> &d→ &fOpen the config-GUI"
  579. send "&2----------[ &a%{cmd}% &2]----------"
  580.  
  581. else if arg 1 is "create":
  582. if arg 2 is set:
  583. if {lobby.minigames.%arg 2%} is not set:
  584. set {lobby.minigames.%arg 2%} to true
  585. set {lobby.minigames.%arg 2%.name} to "&cNone"
  586. set {lobby.minigames.%arg 2%.lore} to "&cNone"
  587. set {lobby.minigames.%arg 2%.item} to "&cNone"
  588. set {lobby.minigames.%arg 2%.slot} to "&cNone"
  589. set {lobby.minigames.%arg 2%.spawn} to "&cNone"
  590. add arg 2 to {lobby.minigames.list::*}
  591.  
  592. send "{@lobby} &2Succesfully made the minigame &a%arg 2%&2!"
  593.  
  594. else:
  595. send "{@lobby} &4The minigame &c%arg 2% &4already exists!"
  596. else:
  597. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1% <minigame>&4."
  598.  
  599. else if arg 1 is "delete" or "remove":
  600. if arg 2 is set:
  601. if {lobby.minigames.%arg 2%} is set:
  602. delete {lobby.minigames.%arg 2%}
  603. delete {lobby.minigames.%arg 2%.name}
  604. delete {lobby.minigames.%arg 2%.lore}
  605. delete {lobby.minigames.%arg 2%.item}
  606. delete {lobby.minigames.%arg 2%.slot}
  607. delete {lobby.minigames.%arg 2%.spawn}
  608. remove arg 2 from {lobby.minigames.list::*}
  609.  
  610. send "{@lobby} &2Succesfully removed the minigame &a%arg 2%&2!"
  611.  
  612. else:
  613. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  614. else:
  615. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
  616.  
  617.  
  618. else if arg 1 is "setspawn":
  619. if arg 2 is set:
  620. if {lobby.minigames.%arg 2%} is set:
  621. set {lobby.minigames.%arg 2%.spawn} to location of player
  622. send "{@lobby} &2Succesfully set the spawn of the minigame%nl%&a%arg 2% &2arg &a%location of player%&2!"
  623.  
  624. else:
  625. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  626. else:
  627. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
  628.  
  629. else if arg 1 is "slot":
  630. if arg 2 is set:
  631. if {lobby.minigames.%arg 2%} is set:
  632. if arg 3 is set:
  633. if (arg 3 parsed as a number) is set:
  634. if {lobby.compassRows} is not set:
  635. set {lobby.compassRows} to 1
  636.  
  637. if {lobby.compassRows} < 1:
  638. set {lobby.compassRows} to 1
  639.  
  640.  
  641. if {lobby.compassRows}*9-1 < arg-3 parsed as a number:
  642. send "{@lobby} &4The amount &c%arg 3% &4is to large bacause the max amount of slots is &c%{lobby.compassRows}*9+1%&4!"
  643.  
  644. else:
  645. loop {lobby.minigames.list::*}:
  646. if {lobby.minigames.%loop-value%.slot} is arg 3:
  647. set {_set} to loop-value
  648. stop loop
  649.  
  650. if {_set} is set:
  651. send "{@lobby} &4The slot &c%arg 3% &4is already in use by the minigame &c%{_set}%&4!"
  652. else:
  653. set {lobby.minigames.%arg 2%.slot} to arg 3
  654. send "{@lobby} &2Succesfully set the slot of the minigame &a%arg 2% &2to &a%arg 3%&2!"
  655. else:
  656. send "{@lobby} &c%arg 3% &4is not a number!"
  657. else:
  658. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <number>&4."
  659. else:
  660. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  661. else:
  662. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame> <number>&4."
  663.  
  664.  
  665. else if arg 1 is "setname":
  666. if arg 2 is set:
  667. if {lobby.minigames.%arg 2%} is set:
  668. if arg 3 is set:
  669. set {lobby.minigames.%arg 2%.name} to arg 3
  670. send "{@lobby} &2Succesfully set the name of the minigame &a%arg 2% &2to &a%arg 3%&2!"
  671.  
  672. else:
  673. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <name>&4."
  674. else:
  675. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  676. else:
  677. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <name>&4."
  678.  
  679. else if arg 1 is "delname" or "deletename":
  680. if arg 2 is set:
  681. delete {lobby.minigames.%arg 2%.name}
  682. send "{@lobby} &2Succesfully deleted the name from the minigame &a%arg 2%&2!"
  683.  
  684. else:
  685. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
  686.  
  687. else if arg 1 is "setlore":
  688. if arg 2 is set:
  689. if {lobby.minigames.%arg 2%} is set:
  690. if arg 3 is set:
  691. set {lobby.minigames.%arg 2%.lore} to arg 3
  692. send "{@lobby} &2Succesfully set the lore of the minigame &a%arg 2% &2to &a%arg 3%&2!"
  693.  
  694. else:
  695. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <lore>&4."
  696. else:
  697. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  698. else:
  699. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame> <lore>&4."
  700.  
  701. else if arg 1 is "dellore" or "deletelore":
  702. if arg 2 is set:
  703. if {lobby.minigames.%arg 2%} is set:
  704. delete {lobby.minigames.%arg 2%.lore}
  705. send "{@lobby} &2Succesfully deleted the lore from the minigame &a%arg 2%&2!"
  706.  
  707. else:
  708. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  709. else:
  710. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <name>&4."
  711.  
  712. else if arg 1 is "setitem":
  713. if arg 2 is set:
  714. if {lobby.minigames.%arg 2%} is set:
  715. if arg 3 is set:
  716. if (arg 3 parsed as an item) is set:
  717. set {lobby.minigames.%arg 2%.item} to arg 3 parsed as an item
  718. send "{@lobby} &2Succesfully set the item from the minigame &a%arg 2% &2to &a%arg 3%&2!"
  719.  
  720. else:
  721. send "{@lobby} &c%arg 3% &4is not an item!"
  722. else:
  723. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <item>&4."
  724. else:
  725. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  726. else:
  727. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame> <item>&4."
  728.  
  729.  
  730. else if arg 1 is "list":
  731.  
  732.  
  733.  
  734. if {lobby.minigames.list::*} is not empty:
  735. loop {lobby.minigames.list::*}:
  736. if {_list} is set:
  737. set {_list} to "%{_list}%&2, &a%loop-value%"
  738. else:
  739. set {_list} to "%loop-value%"
  740.  
  741.  
  742. else:
  743. set {_list} to "Geen"
  744.  
  745. send "{@lobby} &2This is the list of all the minigames:%nl%&a%{_list}%"
  746.  
  747.  
  748. else if arg 1 is "setrows":
  749. if arg 2 is set:
  750. if (arg 2 parsed as a number) is set:
  751. if (arg-2 parsed as a number) < 7:
  752. set {lobby.compassRows} to (arg-2 parsed as a number)
  753. send "{@lobby} &2Succesfully set the amount of rows to &a%arg 2%&2!"
  754.  
  755. else:
  756. send "{@lobby} &4The max amount of rows is &c6&4!"
  757. else:
  758. send "{@lobby} &c%arg 2% &4is not a number!"
  759. else:
  760. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <number>&4."
  761.  
  762.  
  763. else if arg 1 is "gui":
  764. if arg 2 is set:
  765. if {lobby.minigames.%arg 2%} is set:
  766. open chest with 2 rows named "&7Config GUI" to player
  767.  
  768. set {_name} to {lobby.minigames.%arg 2%.name}
  769. replace "&" in {_name} with "§"
  770.  
  771. set {_lore} to {lobby.minigames.%arg 2%.lore}
  772. replace "&" in {_lore} with "§"
  773.  
  774.  
  775. format gui slot 2 of player with a book named "&2Minigame: &a%arg 2%" to do nothing
  776. format gui slot 3 of player with a name tag named "&2Name: &f%{_name}%" to close then run function changeName(player, "%arg 2%")
  777. format gui slot 4 of player with a paper named "&2Lore: &f%{_lore}%" to close then run function changeLore(player, "%arg 2%")
  778. format gui slot 5 of player with a item frame named "&2Item: &a%{lobby.minigames.%arg 2%.item}%" to close then run function changeItem(player, "%arg 2%")
  779. format gui slot 6 of player with a clock named "&2Slot: &a%{lobby.minigames.%arg 2%.slot}%" to close then run function setSlot(player, "%arg 2%")
  780.  
  781. format gui slot 12 of player with a paper named "&2Spawn: &a%{lobby.minigames.%arg 2%.spawn}%" to close then run function setSpawn(player, "%arg 2%")
  782. format gui slot 13 of player with a barrier named "&cClose menu" to close
  783. format gui slot 14 of player with redstone named "&4Delete" to close then run function deleteMinigame(player, "%arg 2%")
  784.  
  785.  
  786. else:
  787. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  788. else:
  789. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
  790. else:
  791. send "{@lobby} &4Do &c/%{cmd}% help &4for more info."
  792.  
  793. command /lobbycrate [<text>] [<text>]:
  794. aliases: /lobbycr, /lcrate
  795. trigger:
  796. if player is in world of {lobby.location}:
  797. if player has permission "votecrate.*":
  798. if arg-1 is set:
  799. if arg-1 is "help":
  800. send "&2----------[ &a%{cmd}% &2]----------"
  801. send "&e&o/%{cmd}% help &d→ &fGet the halp page"
  802. send "&e&o/%{cmd}% list &d→ &fGet a list with all crates"
  803. send "&e&o/%{cmd}% create <crate> &d→ &fCreate a create"
  804. send "&e&o/%{cmd}% delete/remove <crate> &d→ &fDelete a crate"
  805. send "&e&o/%{cmd}% path <crate> &d→ &fGet the edit path of a crate"
  806. send "&e&o/%{cmd}% get <crate> &d→ &fGet a crate"
  807. send "&2----------[ &a%{cmd}% &2]----------"
  808.  
  809. else if arg-1 is "list":
  810. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  811. if {_list::*} is not empty:
  812. loop {_list::*}:
  813. if {_list} is set:
  814. set {_list} to "%{_list}%&2, &a%loop-value%"
  815. else:
  816. set {_list} to "%loop-value%"
  817.  
  818. send "{@lobby} &2There are the following crates:%nl%&a%{_list}%"
  819.  
  820. else:
  821. send "{@lobby} &2There are no crates made yet."
  822.  
  823.  
  824. else if arg-1 is "create":
  825. if arg-2 is set:
  826. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  827. set {_arg2} to "%arg-2 to lower case%"
  828. if contains({_list::*}, {_arg2}):
  829. send "{@lobby} &4The crate &c%{_arg2}% &4already exists!"
  830.  
  831.  
  832. else:
  833.  
  834. send "{@lobby} &2Making the crate &a%{_arg2}%&2..."
  835. add {_arg2} to yml list "Lobby.Crates.List" of file "{@config}"
  836. create file "{@path}/%{_arg2}%.yml"
  837. add "diamond_sword" to yml list "Item.List" of file "{@path}/%{_arg2}%.yml"
  838. add "diamond_sword-1" to yml list "Item.ConfigName" of file "{@path}/%{_arg2}%.yml"
  839.  
  840. set yml value "Item.Chance.diamond_sword-1" of file "{@path}/%{_arg2}%.yml" to "100"
  841. set yml value "Item.Name.diamond_sword-1" of file "{@path}/%{_arg2}%.yml" to "Diamond Sword"
  842. set yml value "Item.Amount.diamond_sword-1" of file "{@path}/%{_arg2}%.yml" to 1
  843.  
  844. add "This is a lore" to yml list "Item.Lore.diamond_sword-1" of file "{@path}/%{_arg2}%.yml"
  845.  
  846. add "sharpness:1" to yml list "Item.Enchants.diamond_sword-1" of file "{@path}/%{_arg2}%.yml"
  847.  
  848. send "{@lobby} &2Succesfully made the crate &a%{_arg2}%&2!"
  849.  
  850.  
  851. else:
  852. send "{@lobby} &4You need to give up a &cname &4for the crate!"
  853.  
  854. else if arg-1 is "delete" or "remove":
  855. if arg-2 is set:
  856. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  857. set {_arg2} to "%arg-2 to lower case%"
  858. if contains({_list::*}, {_arg2}):
  859. send "{@lobby} &2Deleting the crate &a%{_arg2}%&2..."
  860.  
  861. remove "%{_arg2}%" from yml list "Lobby.Crates.List" of file "{@config}"
  862. delete file "{@path}/%{_arg2}%.yml"
  863.  
  864. send "{@lobby} &2Succesfully deleted the crate &a%{_arg2}%&2!"
  865.  
  866. else:
  867. send "{@lobby} &4The crate &c%{_arg2}% &4doesn't exist!"
  868.  
  869.  
  870.  
  871.  
  872. else:
  873. send "{@lobby} &4You need to give up a &cname &4of the crate you want to delete!"
  874.  
  875. else if arg-1 is "path":
  876. if arg-2 is set:
  877. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  878. set {_arg2} to "%arg-2 to lower case%"
  879. #if {_list::*} contains not {_arg2}:
  880. if contains({_list::*}, {_arg2}):
  881. send "{@lobby} &2Location of %{_arg2}%: &a{@path}/%{_arg2}%&2."
  882.  
  883.  
  884. else:
  885. send "{@lobby} &4The crate &c%{_arg2}% &4doesn't exists!"
  886. else:
  887. send "{@lobby} &4You need to give up a &cname &4of the crate you want to get the path of!"
  888.  
  889. else if arg-1 is "get":
  890. if arg 2 is set:
  891. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  892. set {_arg2} to "%arg-2 to lower case%"
  893. if contains({_list::*}, {_arg2}):
  894. send "{@lobby} &2Here you have the &a%{_arg2}% &2crate!%nl%&2Place it to create a chest."
  895. give player 1 chest named "&e%{_arg2}%" with lore "&7Place to create a crate!"
  896. else:
  897. send "{@lobby} &4The crate &c%{_arg2}% &4doesn't exist!"
  898. else:
  899. send "{@lobby} &4You must give up a crate type!"
  900.  
  901. else:
  902. send "{@lobby} &4Do &c/%{cmd}% help &4for more info."
  903. else:
  904. send "{@lobby} &4Do &c/%{cmd}% help &4for more info."
  905.  
  906.  
  907. command /key [<text>] [<text>] [<text>] [<text>]:
  908. trigger:
  909. if player has permission "key.*":
  910. if arg-1 is set:
  911. if arg-1 is "help":
  912. send "&2----------[ &a%{cmd}% &2]----------"
  913. send "&e&o/%{cmd}% help &d→ &fGet the halp page"
  914. send "&e&o/%{cmd}% get <crate/all> [number] &d→ &fGet a crate"
  915. send "&e&o/%{cmd}% give <player> <crate/all> [number] &d→ &fGive a key to open a crate to a player"
  916. send "&e&o/%{cmd}% remove <all/crate> [number] [player] &d→ &fRemove a key from a player"
  917. send "&e&o/%{cmd}% clear <all/crate> [player] &d→ &fClear the keys from a player"
  918. send "&e&o/%{cmd}% keys <all/crate> [player] &d→ &fGet the amount of keys from a player"
  919. send "&2----------[ &a%{cmd}% &2]----------"
  920.  
  921. else if arg-1 is "get":
  922. if arg-2 is "all":
  923. if arg-3 is set:
  924. if (arg-3 parsed as a number) is set:
  925. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  926. set {_num} to arg-3 parsed as a number
  927. loop {_num} times:
  928. loop {_list::*}:
  929. add 1 to {keys.%player%.%loop-value-2%}
  930.  
  931. send "{@lobby} &2You have recieved all the &a%arg-3% &2times!"
  932.  
  933. else:
  934. send "{@lobby} &c%arg-3% &4is not a number!"
  935. else:
  936. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  937. loop {_list::*}:
  938. add 1 to {keys.%player%.%loop-value%}
  939.  
  940. send "{@lobby} &2You have recieved all keys!"
  941.  
  942. else if arg-2 is set:
  943. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  944. if contains({_list::*}, "%arg-2 to lower case%"):
  945. if arg-3 is set:
  946. if (arg-3 parsed as a number) is set:
  947. add (arg-3 parsed as a number) to {keys.%player%.%arg-2 to lower case%}
  948. send "{@lobby} &2You have recieved &a%arg-2 to lower case% &2key &a%arg-3% &2times!"
  949. else:
  950. send "{@lobby} &c%arg-3% &4is not a number!"
  951. else:
  952. add 1 to {keys.%player%.%arg-2 to lower case%}
  953.  
  954. send "{@lobby} &2You have recieved a &a%arg-2 to lower case% &2key!"
  955. else:
  956. send "{@lobby} &4The crate &c%arg-2 to lower case% &4doesn't exist."
  957. else:
  958. send "{@lobby} &4You must give up a &ccrate&4!"
  959.  
  960. else if arg-1 is "give":
  961. if arg-2 is set:
  962. if (arg-2 parsed as a player) is set:
  963. if arg-3 is set:
  964. if arg-3 is "all":
  965. if arg-4 is set:
  966. if (arg-4 parsed as a number) is set:
  967. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  968. set {_num} to arg-4 parsed as a number
  969. loop {_num} times:
  970. loop {_list::*}:
  971. add 1 to {keys.%arg-2 parsed as a player%.%loop-value-2%}
  972.  
  973. send "{@lobby} &2Succesfully given &a%name of arg-2 parsed as a player% &2all the keys &a%arg-4% &2times!"
  974. send "{@lobby} &2You have recieved all the keys &a%arg-4% &2times!" to arg-2 parsed as a player
  975.  
  976. else:
  977. send "{@lobby} &c%arg-3% &4is not a number!"
  978. else:
  979. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  980. loop {_list::*}:
  981. add 1 to {keys.%arg-2 parsed as a player%.%loop-value%}
  982.  
  983. send "{@lobby} &2Succesfully given &a%name of arg-2 parsed as a player% &2all the keys!"
  984. send "{@lobby} &2You have recieved all the keys!" to arg-2 parsed as a player
  985. else:
  986. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  987. if contains({_list::*}, "%arg-3 to lower case%"):
  988. if arg-4 is set:
  989. if (arg-4 parsed as a number) is set:
  990.  
  991. add (arg-4 parsed as a number) to {keys.%arg-2%.%arg-3 to lower case%}
  992.  
  993. send "{@lobby} &2Succesfully given &a%name of arg-2 parsed as a player% &2the &a%arg-3 to lower case% &2key &a%arg-4% &2times!"
  994. send "{@lobby} &2You have recieved the &a%arg-3 to lower case% &2key &a%arg-4% &2times!" to arg-2 parsed as a player
  995.  
  996. else:
  997. send "{@lobby} &c%arg-3% &4is not a number!"
  998. else:
  999. add 1 to {keys.%arg-2 parsed as a player%.%arg-3 to lower case%}
  1000.  
  1001. send "{@lobby} &2Succesfully given &a%name of arg-2 parsed as a player% &2the &a%arg-3 to lower case% &2key!"
  1002. send "{@lobby} &2You have recieved the &a%arg-3 to lower case% &2key!" to arg-2 parsed as a player
  1003. else:
  1004. send "{@lobby} &4The crate &c%arg-3 to lower case% &4doesn't exist!"
  1005. else:
  1006. send "{@lobby} &4You must give up a &ccrate&4!"
  1007. else:
  1008. send "{@lobby} &4The player &c%arg-2% &4is not online!"
  1009. else:
  1010. send "{@lobby} &4You must give up a &cplayer&4!"
  1011.  
  1012.  
  1013.  
  1014. else if arg-1 is "remove":
  1015. if arg-2 is set:
  1016. if arg-2 is "all":
  1017. if arg-3 is set:
  1018. if (arg-3 parsed as a number) is set:
  1019. if arg-4 is set:
  1020. if (arg-4 parsed as a player) is set:
  1021. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1022. set {_num} to arg-3 parsed as a number
  1023. loop {_list::*}:
  1024. if {keys.%arg-4 parsed as a player%.%loop-value%}-{_num} >= 0:
  1025. remove {_num} from {keys.%name of arg-4 parsed as a player%.%loop-value%}
  1026. else:
  1027. set {keys.%arg-4 parsed as a player%.%loop-value%} to 0
  1028.  
  1029. send "{@lobby} &2Succesfully removed &a%arg-3% &2from all the keys of &a%name of arg-4 parsed as a player%&2!"
  1030. send "{@lobby} &2Removed &a%arg-3% &2from your keys!" to arg-4 parsed as a player
  1031.  
  1032. else:
  1033. send "{@lobby} &4The player &c%arg-4% &4is not online!"
  1034. else:
  1035. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1036. loop {_list::*}:
  1037. if {keys.%player%.%loop-value%}-(arg-3 parsed as a number) >= 0:
  1038. remove (arg-3 parsed as a number) from {keys.%player%.%loop-value%}
  1039. else:
  1040. set {keys.%player%.%loop-value%} to 0
  1041.  
  1042. send "{@lobby} &2Succesfully removed &a%arg-3% &2from all the keys!"
  1043.  
  1044. else:
  1045. send "{@lobby} &c%arg-3% &4is not a number!"
  1046. else:
  1047. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1048. loop {_list::*}:
  1049. if {keys.%player%.%loop-value%}-1 >= 0:
  1050. remove 1 from {keys.%player%.%loop-value%}
  1051.  
  1052. send "{@lobby} &2Succesfully removed &a1 &2from all the keys"
  1053. else:
  1054. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1055. if contains({_list::*}, "%arg-2 to lower case%"):
  1056. if arg-3 is set:
  1057. if (arg-3 parsed as a number) is set:
  1058. if arg-4 is set:
  1059. if (arg-4 parsed as a player) is set:
  1060. if {keys.%arg-4 parsed as a player%.%arg-2 to lower case%}-(arg-3 parsed as a number) >= 0:
  1061. remove (arg-3 parsed as a number) from {keys.%name of arg-4 parsed as a player%.%arg-2 to lower case%}
  1062. else:
  1063. set {keys.%arg-4 parsed as a player%.%arg-2 to lower case%} to 0
  1064.  
  1065. send "{@lobby} &2Succesfully removed &a%arg-3% %arg-2 to lower case% &2keys from &a%name of arg-4 parsed as a player%&2!"
  1066. send "{@lobby} &a%arg-3% %arg-2 to lower case% &2keys have been removed!" to arg-4 parsed as a player
  1067.  
  1068. else:
  1069. send "{@lobby} &4The player &c%arg-4% &4is not online!"
  1070. else:
  1071.  
  1072. if {keys.%player%.%arg-2 to lower case%}-(arg-3 parsed as a number) >= 0:
  1073. remove (arg-3 parsed as a number) from {keys.%player%.%arg-2 to lower case%}
  1074. send "{@lobby} &2Succesfully removed &a%arg-3% %arg-2 to lower case% &2keys!"
  1075.  
  1076. else:
  1077. send "{@lobby} &c%arg-3% &4is not a number!"
  1078.  
  1079. else:
  1080. if {keys.%player%.%arg-2 to lower case%}-1 >= 0:
  1081. remove 1 from {keys.%player%.%arg-2 to lower case%}
  1082. send "{@lobby} &2Succesfully removed &a1 %arg-2 to lower case% &2keys!"
  1083. else:
  1084. send "{@lobby} &4The crate &c%arg-2 to lower case% &4doesn't exist."
  1085. else:
  1086. send "{@lobby} &4You must give up a &ccrate&4!"
  1087.  
  1088. #send "&e&o/%{cmd}% clear <all/crate> [player] &d→ &fClear the keys from a player"
  1089. else if arg-1 is "clear":
  1090. if arg-2 is set:
  1091. if arg-2 is "all":
  1092. if arg-3 is set:
  1093. if (arg-3 parsed as a player) is set:
  1094. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1095. loop {_list::*}:
  1096. set {keys.%arg-3 parsed as a player%.%loop-value%} to 0
  1097.  
  1098. send "{@lobby} &2Succesfully cleared &aall keys &2of &a%name of arg-3 parsed as a player%&2!"
  1099. send "{@lobby} &aAll &2your &akeys &2have been cleared!" to arg-3 parsed as a player
  1100. else:
  1101. send "{@lobby} &4The player &c%arg-3% &4is not online!"
  1102. else:
  1103. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1104. loop {_list::*}:
  1105. set {keys.%player%.%loop-value%} to 0
  1106.  
  1107. send "{@lobby} &2You have cleared &aall &2your &akeys&2!"
  1108. else:
  1109. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1110. if contains({_list::*}, "%arg-2 to lower case%"):
  1111. if arg-3 is set:
  1112. if (arg-3 parsed as a player) is set:
  1113. set {keys.%arg-3 parsed as a player%.%arg-2 to lower case%} to 0
  1114. send "{@lobby} &2You have cleared the &a%arg-2 to lower case% keys &2from &a%name of arg-3 parsed as a player%&2!"
  1115. send "{@lobby} &2Your &a%arg-2 to lower case% keys &2have been cleared!" to arg-3 parsed as a player
  1116.  
  1117. else:
  1118. send "{@lobby} &4The player &c%arg-3% &4is not online!"
  1119.  
  1120. else:
  1121. set {keys.%player%.%arg-2 to lower case%} to 0
  1122. send "{@lobby} &2Succesfully cleared the &a%arg-2 to lower case% keys&2!"
  1123.  
  1124. else:
  1125. send "{@lobby} &4The crate &c%arg-2 to lower case% &4doesn't exist!"
  1126. else:
  1127. send "{@lobby} &4You must give up a &ccrate&4!"
  1128.  
  1129. else if arg-1 is "keys":
  1130. if arg-2 is set:
  1131. if arg-2 is "all":
  1132. if arg-3 is set:
  1133. if (arg-3 parsed as a player) is set:
  1134. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1135. loop {_list::*}:
  1136. if {keys.%arg-3 parsed as a player%.%loop-value%} is not set:
  1137. set {keys.%arg-3 parsed as a player%.%loop-value%} to 0
  1138.  
  1139. if {_keys} is not set:
  1140. set {_keys} to "&2%loop-value%: &a%{keys.%name of arg-3 parsed as a player%.%loop-value%}%"
  1141. else:
  1142. set {_keys} to "%{_keys}%%nl%&2%loop-value%: &a%{keys.%name of arg-3 parsed as a player%.%loop-value%}%"
  1143.  
  1144. send "{@lobby} &2This is the list of keys from &a%name of arg-3 parsed as a player%&2:%nl%%{_keys}%"
  1145.  
  1146. else:
  1147. send "{@lobby} &4The player &c%arg-3% &4is not online!"
  1148. else:
  1149. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1150. loop {_list::*}:
  1151. if {keys.%player%.%loop-value%} is not set:
  1152. set {keys.%player%.%loop-value%} to 0
  1153. if {_keys} is not set:
  1154. set {_keys} to "&2%loop-value%: &a%{keys.%player%.%loop-value%}%"
  1155. else:
  1156. set {_keys} to "%{_keys}%%nl%&2%loop-value%: &a%{keys.%player%.%loop-value%}%"
  1157.  
  1158. send "{@lobby} &2This is your list of keys&2:%nl%%{_keys}%"
  1159. else:
  1160. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1161. if contains({_list::*}, "%arg-2 to lower case%"):
  1162. if arg-3 is set:
  1163. if (arg-3 parsed as a player) is set:
  1164. if {keys.%arg-3 parsed as a player%.%arg-2 to lower case%} is not set:
  1165. set {keys.%arg-3 parsed as a player%.%arg-2 to lower case%} to 0
  1166.  
  1167. send "{@lobby} &a%name of arg-3 parsed as a player% &2has &a%{keys.%arg-3%.%arg-2 to lower case%}% %arg-2 to lower case% &2keys."
  1168.  
  1169. else:
  1170. send "{@lobby} &4The player &c%arg-3% &4is not online!"
  1171. else:
  1172. if {keys.%player%.%arg-2 to lower case%} is not set:
  1173. set {keys.%player%.%arg-2 to lower case%} to 0
  1174.  
  1175. send "{@lobby} &2You have &a%{keys.%player%.%arg-2 to lower case%}% %arg-2 to lower case% &2keys."
  1176. else:
  1177. send "{@lobby} &4The crate &c%arg-2 to lower case% &4doesn't exist!"
  1178. else:
  1179. send "{@lobby} &4You need to give up a &ccrate&4!"
  1180. else:
  1181. send "{@lobby} &4Do &c/%{cmd}% help &4for more info!"
  1182. else:
  1183. send "{@lobby} &4Do &c/%{cmd}% help &4for more info!"
Add Comment
Please, Sign In to add comment