Zeldaboy111

Skript #264 ]|[ Crate (4)

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