Zeldaboy111

Skript #262 ]|[ Crates (2)

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