Zeldaboy111

Skript #260 - Keys (1)

Nov 14th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.80 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 openCompass(p: Player):
  25. if {lobby.compassRows} is not set:
  26. set {lobby.compassRows} to 1
  27.  
  28. open chest with {lobby.compassRows} rows named "{@cGuiName}" to {_p}
  29.  
  30. loop {lobby.minigames.list::*}:
  31. if {lobby.minigames.%loop-value%.slot} starts with "-":
  32. stop
  33. else:
  34. if ({lobby.minigames.%loop-value%.slot} parsed as a number) is set:
  35.  
  36. if {lobby.minigames.%loop-value%.item} is "&cNone":
  37. set {_item} to paper
  38.  
  39. else if ({lobby.minigames.%loop-value%.item} parsed as an item) is not set:
  40. set {_item} to paper
  41.  
  42. else:
  43. set {_item} to {lobby.minigames.%loop-value%.item}
  44.  
  45.  
  46. set {_slot} to ({lobby.minigames.%loop-value%.slot} parsed as a number)
  47.  
  48. if {lobby.minigames.%loop-value%.name} is set:
  49. if {lobby.minigames.%loop-value%.name} is not "&cNone":
  50. set {_name} to {lobby.minigames.%loop-value%.name}
  51. replace "&" in {_name} with "§"
  52. if {lobby.minigames.%loop-value%.lore} is set:
  53. if {lobby.minigames.%loop-value%.lore} is not "&cNone":
  54. set {_lore} to {lobby.minigames.%loop-value%.lore}
  55. replace "&" in {_lore} with "§"
  56. format gui slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item named "%{_name}%" with lore "%{_lore}%" to do nothing
  57. else:
  58. format gui slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item named "%{_name}%" to do nothing
  59. else:
  60. format gui slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item named "%{_name}%" to do nothing
  61. else:
  62. format gui slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item to do nothing
  63. else:
  64. format gui slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item to do nothing
  65.  
  66.  
  67. function changeName(p: Player, s: String):
  68. open chest with 3 rows named "&4Name &c%{_s}%" to {_p}
  69.  
  70. format gui slot 12 of {_p} with green_wool named "&aChange" to run:
  71. close {_p}'s inventory
  72. send "{@lobby} &2Click <suggest command:/lcompass setname %{_s}% [naam]>&ahere<reset> &2to edit the name." to {_p}
  73.  
  74.  
  75. format gui slot 14 of {_p} with red_wool named "&cDeny" to run:
  76. close {_p}'s inventory
  77. send "{@lobby} &4You have chosen to give the minigame%nl%&c%{_s}% &4not an other name." to {_p}
  78.  
  79. function changeLore(p: Player, s: String):
  80. open chest with 3 rows named "&4Lore &c%{_s}%" to {_p}
  81.  
  82. format gui slot 12 of {_p} with green_wool named "&aChange" to run:
  83. close {_p}'s inventory
  84. send "{@lobby} &2Click <suggest command:/lcompass setlore %{_s}% [lore]>&ahere<reset> &2to edit the lore." to {_p}
  85.  
  86. format gui slot 14 of {_p} with red_wool named "&cDeny" to run:
  87. close {_p}'s inventory
  88. send "{@lobby} &4You have chosen to give the minigame%nl%&c%{_s}% &4not an other lore." to {_p}
  89.  
  90. function changeItem(p: Player, s: String):
  91. open chest with 3 rows named "&4Item &c%{_s}%" to {_p}
  92.  
  93. format gui slot 12 of {_p} with green_wool named "&aChange" to run:
  94. close {_p}'s inventory
  95. send "{@lobby} &2Click <suggest command:/lcompass setitem %{_s}% [item]>&ahere<reset> &2to edit the item." to {_p}
  96.  
  97. format gui slot 14 of {_p} with red_wool named "&cDeny" to run:
  98. close {_p}'s inventory
  99. send "{@lobby} &4You have chosen to give the minigame%nl%&c%{_s}% &4not an other item." to {_p}
  100.  
  101. function setSlot(p: Player, s: String):
  102. open chest with 3 rows named "&4Slot &c%{_s}%" to {_p}
  103.  
  104. format gui slot 12 of {_p} with green_wool named "&aChange" to run:
  105. close {_p}'s inventory
  106. send "{@lobby} &2Click <suggest command:/lcompass slot %{_s}% [slot]>&ahere<reset> &2to edit the slot." to {_p}
  107.  
  108. format gui slot 14 of {_p} with red_wool named "&cDeny" to run:
  109. close {_p}'s inventory
  110. send "{@lobby} &4You have chosen to give the minigame%nl%&c%{_s}% &4not an other slot." to {_p}
  111.  
  112.  
  113. function setSpawn(p: Player, s: String):
  114. open chest with 3 rows named "&4Spawn &c%{_s}%" to {_p}
  115.  
  116. format gui slot 12 of {_p} with green_wool named "&aSet spawn" to run:
  117. close {_p}'s inventory
  118. send "{@lobby} &2Click <command:/lcompass setspawn %{_s}%>&ahere<reset> &2to set the spawn." to {_p}
  119.  
  120. format gui slot 14 of {_p} with red_wool named "&cDeny" to run:
  121. close {_p}'s inventory
  122. send "{@lobby} &4You have chosen to give the minigame%nl%&c%{_s}% &4not an other spawn." to {_p}
  123.  
  124.  
  125. function deleteMinigame(p: Player, s: String):
  126. open chest with 3 rows named "&4Delete &c%{_s}%" to {_p}
  127.  
  128. format gui slot 12 of {_p} with green_wool named "&aAccept" to run:
  129. close {_p}'s inventory
  130. execute player command "/lcompass delete %{_s}%"
  131.  
  132. format gui slot 14 of {_p} with red_wool named "&cDeny" to run:
  133. close {_p}'s inventory
  134. send "{@lobby} &4Je hebt ervoor gekozen om de minigame%nl%&c%{_s}% &4niet te verwijderen." to {_p}
  135.  
  136. function contains(list: objects, check: object) :: boolean:
  137. loop {_list::*}:
  138. if loop-value is {_check}:
  139. return true
  140. return false
  141.  
  142. #------------------- Periotic Events -------------------
  143.  
  144.  
  145.  
  146.  
  147.  
  148. #------------------- Events -------------------
  149. on enable:
  150. if file "{@config}" doesn't exist:
  151. create file "{@config}"
  152.  
  153.  
  154. on join:
  155. if {lobby.location} is set:
  156. teleport player to {lobby.location}
  157. set join message to ""
  158. wait 10 ticks
  159.  
  160. clear player's inventory
  161. send "{@lobby} &fThe player %player% has joined!" to all players in world of player
  162. set slot 4 of player to a compass named "{@lcompass}"
  163.  
  164.  
  165. on inventory click:
  166. if player is in world of {lobby.location}:
  167. if clicked item is a compass named "{@lcompass}":
  168. cancel event
  169. close player's inventory
  170. openCompass(player)
  171.  
  172. on click:
  173. if player is in world of {lobby.location}:
  174. if player's held item is a compass named "{@lcompass}":
  175. cancel event
  176. openCompass(player)
  177.  
  178.  
  179. on command:
  180. command is "plugins" or "pl":
  181. cancel event
  182.  
  183. if player is not op:
  184. stop
  185.  
  186. else:
  187. set {_list::*} to list of plugins
  188. set {_count} to 0
  189. loop {_list::*}:
  190. add 1 to {_count}
  191. send "{@logo} Plugin list:%nl%&f(&a%{_count}%&f) &2%list of plugins%"
  192.  
  193. else:
  194. set {cmd} to "%command to lower case%"
  195.  
  196. on place of chest:
  197. set {_world} to world of event-block
  198. if {_world} is "%world of {lobby.location}%":
  199. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  200. if contains({_list::*}, "%uncolored name of player's tool%"):
  201. add location of event-block to {lobbycrate.%uncolored name of player's tool%.location::*}
  202. send "{@lobby} &2Succesfully created a &a%uncolored name of player's tool% &2Crate!"
  203. set {holo-crate-%world of event-block%-%location of event-block%} to new hologram at location above event-block
  204. add text "&a&l%uncolored name of player's tool%" to hologram {holo-crate-%world of event-block%-%location of event-block%}
  205.  
  206.  
  207. on break of chest:
  208. set {_world} to world of event-block
  209. if {_world} is "%world of {lobby.location}%":
  210. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  211. loop {_list::*}:
  212. loop {lobbycrate.%loop-value-1%.location::*}:
  213. if "%loop-value-2%" is "%location of event-block%":
  214. remove location of event-block from {lobbycrate.%loop-value-1%.location::*}
  215. unregister hologram {holo-crate-%world of event-block%-%location of event-block%}
  216. send "{@lobby} &2Succesfully removed a &a%loop-value-1% &2Crate!"
  217.  
  218.  
  219.  
  220. on rightclick on a chest:
  221. set {_world} to world of clicked block
  222. if {_world} is "%world of {lobby.location}%":
  223. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  224. loop {_list::*}:
  225.  
  226. loop {lobbycrate.%loop-value-1%.location::*}:
  227. if "%loop-value-2%" is "%location of clicked block%":
  228. cancel event
  229. stop loop
  230.  
  231.  
  232. on chat:
  233. if world of player is world of {lobby.location}:
  234. cancel event
  235. send "&7[&e%player%&7] &8>> &f%message%" to all players in world of player
  236. send "&7[&eLobby&7][&e%player%&7] &f>> %message%" to console
  237.  
  238. #------------------- Commands -------------------
  239. command /lobby [<text>] [<text>]:
  240. aliases: /hub
  241. trigger:
  242. if player has permission "lobby.*":
  243. if arg-1 is set:
  244. if arg-1 is "help":
  245. send "&2----------[ &a%{cmd}% &2]----------"
  246. send "&e&o/%{cmd}% help &d→ &fGet the help page"
  247. send "&e&o/%{cmd}% set &d→ &fSet the lobby"
  248. send "&2----------[ &a%{cmd}% &2]----------"
  249.  
  250. else if arg-1 is "set":
  251. send "{@logo} &2Succesfully set the &a%{cmd}% &2to your location!"
  252. set {lobby.location} to location of player
  253.  
  254. else:
  255. if {lobby.location} is set:
  256. if world of player is not "%world of {lobby.location}%":
  257. teleport player to {lobby.location}
  258. send "{@lobby} &fThe player %player% went to the lobby!" to all players in world of player
  259. clear player's inventory
  260. set slot 4 of player to a compass named "{@lcompass}"
  261.  
  262. else:
  263. teleport player to {lobby.location}
  264.  
  265.  
  266. else:
  267. send "{@lobby} &cThe %{cmd}% is not set yet!"
  268.  
  269.  
  270. else if {lobby.location} is set:
  271. if world of player is not "%world of {lobby.location}%":
  272. teleport player to {lobby.location}
  273. send "{@lobby} &fThe player %player% went to the lobby!" to all players in world of player
  274. clear player's inventory
  275. set slot 4 of player to a compass named "{@lcompass}"
  276.  
  277. else:
  278. teleport player to {lobby.location}
  279.  
  280. else:
  281. send "{@lobby} &cThe %{cmd}% is not set yet!"
  282.  
  283.  
  284. command /lobbycompass [<text>] [<text>] [<text>]:
  285. aliases: /lcomp, /lcompass
  286. trigger:
  287. if player has permission "lobbycompass.*":
  288. if arg 1 is not set:
  289. send "{@lobby} &4Do &c&o/%{cmd}% help &4for more info."
  290.  
  291. else if arg 1 is set:
  292. if arg 1 is "help":
  293. send "&2----------[ &a%{cmd}% &2]----------"
  294. send "&e&o/%{cmd}% help &d→ &fKrijg help pagina"
  295. send "&e&o/%{cmd}% create <minigame> &d→ &fCreate a minigame"
  296. send "&e&o/%{cmd}% remove/delete <minigame> &d→ &fDelete a minigame"
  297. send "&e&o/%{cmd}% setspawn <minigame> &d→ &fSet the spawn of a minigame"
  298. send "&e&o/%{cmd}% slot <minigame> <number> &d→ &fSet the GUI slot of a minigame"
  299.  
  300. send "&e&o/%{cmd}% setname <minigame> <name> &d→ &fSet a name"
  301. send "&e&o/%{cmd}% deletename <minigame> &d→ &fDelete the name of a minigame"
  302. send "&e&o/%{cmd}% setlore <minigame> <lore> &d→ &fSet a lore"
  303. send "&e&o/%{cmd}% deletelore <minigame> <minigame> &d→ &fDelete the lore of a minigame"
  304. send "&e&o/%{cmd}% setitem <minigame> <item> &d→ &fSet the item of a minigame"
  305. send "&e&o/%{cmd}% list &d→ &fGet a list of all the minigames"
  306. send "&e&o/%{cmd}% setrows <number> &d→ &fSet the amount of rows in the GUI"
  307. send "&e&o/%{cmd}% gui <minigame> &d→ &fOpen the config-GUI"
  308. send "&2----------[ &a%{cmd}% &2]----------"
  309.  
  310. else if arg 1 is "create":
  311. if arg 2 is set:
  312. if {lobby.minigames.%arg 2%} is not set:
  313. set {lobby.minigames.%arg 2%} to true
  314. set {lobby.minigames.%arg 2%.name} to "&cNone"
  315. set {lobby.minigames.%arg 2%.lore} to "&cNone"
  316. set {lobby.minigames.%arg 2%.item} to "&cNone"
  317. set {lobby.minigames.%arg 2%.slot} to "&cNone"
  318. set {lobby.minigames.%arg 2%.spawn} to "&cNone"
  319. add arg 2 to {lobby.minigames.list::*}
  320.  
  321. send "{@lobby} &2Succesfully made the minigame &a%arg 2%&2!"
  322.  
  323. else:
  324. send "{@lobby} &4The minigame &c%arg 2% &4already exists!"
  325. else:
  326. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1% <minigame>&4."
  327.  
  328. else if arg 1 is "delete" or "remove":
  329. if arg 2 is set:
  330. if {lobby.minigames.%arg 2%} is set:
  331. delete {lobby.minigames.%arg 2%}
  332. delete {lobby.minigames.%arg 2%.name}
  333. delete {lobby.minigames.%arg 2%.lore}
  334. delete {lobby.minigames.%arg 2%.item}
  335. delete {lobby.minigames.%arg 2%.slot}
  336. delete {lobby.minigames.%arg 2%.spawn}
  337. remove arg 2 from {lobby.minigames.list::*}
  338.  
  339. send "{@lobby} &2Succesfully removed the minigame &a%arg 2%&2!"
  340.  
  341. else:
  342. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  343. else:
  344. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
  345.  
  346.  
  347. else if arg 1 is "setspawn":
  348. if arg 2 is set:
  349. if {lobby.minigames.%arg 2%} is set:
  350. set {lobby.minigames.%arg 2%.spawn} to location of player
  351. send "{@lobby} &2Succesfully set the spawn of the minigame%nl%&a%arg 2% &2arg &a%location of player%&2!"
  352.  
  353. else:
  354. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  355. else:
  356. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
  357.  
  358. else if arg 1 is "slot":
  359. if arg 2 is set:
  360. if {lobby.minigames.%arg 2%} is set:
  361. if arg 3 is set:
  362. if (arg 3 parsed as a number) is set:
  363. if {lobby.compassRows} is not set:
  364. set {lobby.compassRows} to 1
  365.  
  366. if {lobby.compassRows} < 1:
  367. set {lobby.compassRows} to 1
  368.  
  369.  
  370. if {lobby.compassRows}*9-1 < arg-3 parsed as a number:
  371. send "{@lobby} &4The amount &c%arg 3% &4is to large bacause the max amount of slots is &c%{lobby.compassRows}*9+1%&4!"
  372.  
  373. else:
  374. loop {lobby.minigames.list::*}:
  375. if {lobby.minigames.%loop-value%.slot} is arg 3:
  376. set {_set} to loop-value
  377. stop loop
  378.  
  379. if {_set} is set:
  380. send "{@lobby} &4The slot &c%arg 3% &4is already in use by the minigame &c%{_set}%&4!"
  381. else:
  382. set {lobby.minigames.%arg 2%.slot} to arg 3
  383. send "{@lobby} &2Succesfully set the slot of the minigame &a%arg 2% &2to &a%arg 3%&2!"
  384. else:
  385. send "{@lobby} &c%arg 3% &4is not a number!"
  386. else:
  387. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <number>&4."
  388. else:
  389. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  390. else:
  391. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame> <number>&4."
  392.  
  393.  
  394. else if arg 1 is "setname":
  395. if arg 2 is set:
  396. if {lobby.minigames.%arg 2%} is set:
  397. if arg 3 is set:
  398. set {lobby.minigames.%arg 2%.name} to arg 3
  399. send "{@lobby} &2Succesfully set the name of the minigame &a%arg 2% &2to &a%arg 3%&2!"
  400.  
  401. else:
  402. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <name>&4."
  403. else:
  404. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  405. else:
  406. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <name>&4."
  407.  
  408. else if arg 1 is "delname" or "deletename":
  409. if arg 2 is set:
  410. delete {lobby.minigames.%arg 2%.name}
  411. send "{@lobby} &2Succesfully deleted the name from the minigame &a%arg 2%&2!"
  412.  
  413. else:
  414. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
  415.  
  416. else if arg 1 is "setlore":
  417. if arg 2 is set:
  418. if {lobby.minigames.%arg 2%} is set:
  419. if arg 3 is set:
  420. set {lobby.minigames.%arg 2%.lore} to arg 3
  421. send "{@lobby} &2Succesfully set the lore of the minigame &a%arg 2% &2to &a%arg 3%&2!"
  422.  
  423. else:
  424. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <lore>&4."
  425. else:
  426. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  427. else:
  428. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame> <lore>&4."
  429.  
  430. else if arg 1 is "dellore" or "deletelore":
  431. if arg 2 is set:
  432. if {lobby.minigames.%arg 2%} is set:
  433. delete {lobby.minigames.%arg 2%.lore}
  434. send "{@lobby} &2Succesfully deleted the lore from the minigame &a%arg 2%&2!"
  435.  
  436. else:
  437. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  438. else:
  439. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <name>&4."
  440.  
  441. else if arg 1 is "setitem":
  442. if arg 2 is set:
  443. if {lobby.minigames.%arg 2%} is set:
  444. if arg 3 is set:
  445. if (arg 3 parsed as an item) is set:
  446. set {lobby.minigames.%arg 2%.item} to arg 3 parsed as an item
  447. send "{@lobby} &2Succesfully set the item from the minigame &a%arg 2% &2to &a%arg 3%&2!"
  448.  
  449. else:
  450. send "{@lobby} &c%arg 3% &4is not an item!"
  451. else:
  452. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <item>&4."
  453. else:
  454. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  455. else:
  456. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame> <item>&4."
  457.  
  458.  
  459. else if arg 1 is "list":
  460.  
  461.  
  462.  
  463. if {lobby.minigames.list::*} is not empty:
  464. loop {lobby.minigames.list::*}:
  465. if {_list} is set:
  466. set {_list} to "%{_list}%&2, &a%loop-value%"
  467. else:
  468. set {_list} to "%loop-value%"
  469.  
  470.  
  471. else:
  472. set {_list} to "Geen"
  473.  
  474. send "{@lobby} &2This is the list of all the minigames:%nl%&a%{_list}%"
  475.  
  476.  
  477. else if arg 1 is "setrows":
  478. if arg 2 is set:
  479. if (arg 2 parsed as a number) is set:
  480. if (arg-2 parsed as a number) < 7:
  481. set {lobby.compassRows} to (arg-2 parsed as a number)
  482. send "{@lobby} &2Succesfully set the amount of rows to &a%arg 2%&2!"
  483.  
  484. else:
  485. send "{@lobby} &4The max amount of rows is &c6&4!"
  486. else:
  487. send "{@lobby} &c%arg 2% &4is not a number!"
  488. else:
  489. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <number>&4."
  490.  
  491.  
  492. else if arg 1 is "gui":
  493. if arg 2 is set:
  494. if {lobby.minigames.%arg 2%} is set:
  495. open chest with 2 rows named "&7Config GUI" to player
  496.  
  497. set {_name} to {lobby.minigames.%arg 2%.name}
  498. replace "&" in {_name} with "§"
  499.  
  500. set {_lore} to {lobby.minigames.%arg 2%.lore}
  501. replace "&" in {_lore} with "§"
  502.  
  503.  
  504. format gui slot 2 of player with a book named "&2Minigame: &a%arg 2%" to do nothing
  505. format gui slot 3 of player with a name tag named "&2Name: &f%{_name}%" to close then run function changeName(player, "%arg 2%")
  506. format gui slot 4 of player with a paper named "&2Lore: &f%{_lore}%" to close then run function changeLore(player, "%arg 2%")
  507. 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%")
  508. 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%")
  509.  
  510. 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%")
  511. format gui slot 13 of player with a barrier named "&cClose menu" to close
  512. format gui slot 14 of player with redstone named "&4Delete" to close then run function deleteMinigame(player, "%arg 2%")
  513.  
  514.  
  515. else:
  516. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  517. else:
  518. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
  519. else:
  520. send "{@lobby} &4Do &c/%{cmd}% help &4for more info."
  521.  
  522. command /lobbycrate [<text>] [<text>]:
  523. aliases: /lobbycr, /lcrate
  524. trigger:
  525. if player is in world of {lobby.location}:
  526. if player has permission "votecrate.*":
  527. if arg-1 is set:
  528. if arg-1 is "help":
  529. send "&2----------[ &a%{cmd}% &2]----------"
  530. send "&e&o/%{cmd}% help &d→ &fGet the halp page"
  531. send "&e&o/%{cmd}% list &d→ &fGet a list with all crates"
  532. send "&e&o/%{cmd}% create <crate> &d→ &fCreate a create"
  533. send "&e&o/%{cmd}% delete/remove <crate> &d→ &fDelete a crate"
  534. send "&e&o/%{cmd}% path <crate> &d→ &fGet the edit path of a crate"
  535. send "&e&o/%{cmd}% get <crate> &d→ &fGet a crate"
  536. send "&2----------[ &a%{cmd}% &2]----------"
  537.  
  538. else if arg-1 is "list":
  539. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  540. if {_list::*} is not empty:
  541. loop {_list::*}:
  542. if {_list} is set:
  543. set {_list} to "%{_list}%&2, &a%loop-value%"
  544. else:
  545. set {_list} to "%loop-value%"
  546.  
  547. send "{@lobby} &2There are the following crates:%nl%&a%{_list}%"
  548.  
  549. else:
  550. send "{@lobby} &2There are no crates made yet."
  551.  
  552.  
  553. else if arg-1 is "create":
  554. if arg-2 is set:
  555. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  556. set {_arg2} to "%arg-2 to lower case%"
  557. if contains({_list::*}, {_arg2}):
  558. send "{@lobby} &4The crate &c%{_arg2}% &4already exists!"
  559.  
  560.  
  561. else:
  562.  
  563. send "{@lobby} &2Making the crate &a%{_arg2}%&2..."
  564. add {_arg2} to yml list "Lobby.Crates.List" of file "{@config}"
  565. create file "{@path}/%{_arg2}%.yml"
  566. add "Be sure to not use names multiple times at Item.ConfigName!!!" to yml list "Item.Info" of file "{@path}/%{_arg2}%.yml"
  567. add "Chances must be 100 in total (Item.Chances)" to yml list "Item.Info" of file "{@path}/%{_arg2}%.yml"
  568.  
  569.  
  570. add "diamond_sword" to yml list "Item.List" of file "{@path}/%{_arg2}%.yml"
  571. add "diamond_sword-1" to yml list "Item.ConfigName" of file "{@path}/%{_arg2}%.yml"
  572.  
  573. set yml value "Item.Chance.diamond_sword-1" of file "{@path}/%{_arg2}%.yml" to "100"
  574. add "Diamond Sword" to yml list "Item.Name.diamond_sword-1" of file "{@path}/%{_arg2}%.yml"
  575. add "sharpness:1" to yml list "Item.Enchants.diamond_sword-1" of file "{@path}/%{_arg2}%.yml"
  576.  
  577. send "{@lobby} &2Succesfully made the crate &a%{_arg2}%&2!"
  578.  
  579.  
  580. else:
  581. send "{@lobby} &4You need to give up a &cname &4for the crate!"
  582.  
  583. else if arg-1 is "delete" or "remove":
  584. if arg-2 is set:
  585. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  586. set {_arg2} to "%arg-2 to lower case%"
  587. if contains({_list::*}, {_arg2}):
  588. send "{@lobby} &2Deleting the crate &a%{_arg2}%&2..."
  589.  
  590. remove "%{_arg2}%" from yml list "Lobby.Crates.List" of file "{@config}"
  591. delete file "{@path}/%{_arg2}%.yml"
  592.  
  593. send "{@lobby} &2Succesfully deleted the crate &a%{_arg2}%&2!"
  594.  
  595. else:
  596. send "{@lobby} &4The crate &c%{_arg2}% &4doesn't exist!"
  597.  
  598.  
  599.  
  600.  
  601. else:
  602. send "{@lobby} &4You need to give up a &cname &4of the crate you want to delete!"
  603.  
  604. else if arg-1 is "path":
  605. if arg-2 is set:
  606. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  607. set {_arg2} to "%arg-2 to lower case%"
  608. #if {_list::*} contains not {_arg2}:
  609. if contains({_list::*}, {_arg2}):
  610. send "{@lobby} &2Location of %{_arg2}%: &a{@path}/%{_arg2}%&2."
  611.  
  612.  
  613. else:
  614. send "{@lobby} &4The crate &c%{_arg2}% &4doesn't exists!"
  615. else:
  616. send "{@lobby} &4You need to give up a &cname &4of the crate you want to get the path of!"
  617.  
  618. else if arg-1 is "get":
  619. if arg 2 is set:
  620. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  621. set {_arg2} to "%arg-2 to lower case%"
  622. if contains({_list::*}, {_arg2}):
  623. send "{@lobby} &2Here you have the &a%{_arg2}% &2crate!%nl%&2Place it to create a chest."
  624. give player 1 chest named "&e%{_arg2}%" with lore "&7Place to create a crate!"
  625. else:
  626. send "{@lobby} &4The crate &c%{_arg2}% &4doesn't exist!"
  627. else:
  628. send "{@lobby} &4You must give up a crate type!"
  629.  
  630. else:
  631. send "{@lobby} &4Do &c/%{cmd}% help &4for more info."
  632. else:
  633. send "{@lobby} &4Do &c/%{cmd}% help &4for more info."
  634.  
  635.  
  636. command /key [<text>] [<text>] [<text>] [<text>]:
  637. trigger:
  638. if player has permission "key.*":
  639. if arg-1 is set:
  640. if arg-1 is "help":
  641. send "&2----------[ &a%{cmd}% &2]----------"
  642. send "&e&o/%{cmd}% help &d→ &fGet the halp page"
  643. send "&e&o/%{cmd}% get <crate/all> [number] &d→ &fGet a crate"
  644. send "&e&o/%{cmd}% give <player> <crate/all> [number] &d→ &fGive a key to open a crate to a player"
  645. send "&e&o/%{cmd}% remove <all/crate> [number] [player] &d→ &fRemove a key from a player"
  646. send "&e&o/%{cmd}% clear <all/crate> [player] &d→ &fClear the keys from a player"
  647. send "&e&o/%{cmd}% keys <all/crate> [player] &d→ &fGet the amount of keys from a player"
  648. send "&2----------[ &a%{cmd}% &2]----------"
  649.  
  650. else if arg-1 is "get":
  651. if arg-2 is "all":
  652. if arg-3 is set:
  653. if (arg-3 parsed as a number) is set:
  654. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  655. set {_num} to arg-3 parsed as a number
  656. loop {_num} times:
  657. loop {_list::*}:
  658. add 1 to {keys.%player%.%loop-value-2%}
  659.  
  660. send "{@lobby} &2You have recieved all the &a%arg-3% &2times!"
  661.  
  662. else:
  663. send "{@lobby} &c%arg-3% &4is not a number!"
  664. else:
  665. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  666. loop {_list::*}:
  667. add 1 to {keys.%player%.%loop-value%}
  668.  
  669. send "{@lobby} &2You have recieved all keys!"
  670.  
  671. else if arg-2 is set:
  672. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  673. if contains({_list::*}, "%arg-2 to lower case%"):
  674. if arg-3 is set:
  675. if (arg-3 parsed as a number) is set:
  676. add (arg-3 parsed as a number) to {keys.%player%.%arg-2 to lower case%}
  677. send "{@lobby} &2You have recieved &a%arg-2 to lower case% &2key &a%arg-3% &2times!"
  678. else:
  679. send "{@lobby} &c%arg-3% &4is not a number!"
  680. else:
  681. add 1 to {keys.%player%.%arg-2 to lower case%}
  682.  
  683. send "{@lobby} &2You have recieved a &a%arg-2 to lower case% &2key!"
  684. else:
  685. send "{@lobby} &4The crate &c%arg-2 to lower case% &4doesn't exist."
  686. else:
  687. send "{@lobby} &4You must give up a &ccrate&4!"
  688.  
  689. else if arg-1 is "give":
  690. if arg-2 is set:
  691. if (arg-2 parsed as a player) is set:
  692. if arg-3 is set:
  693. if arg-3 is "all":
  694. if arg-4 is set:
  695. if (arg-4 parsed as a number) is set:
  696. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  697. set {_num} to arg-4 parsed as a number
  698. loop {_num} times:
  699. loop {_list::*}:
  700. add 1 to {keys.%name of arg-2 parsed as a player%.%loop-value-2%}
  701.  
  702. send "{@lobby} &2Succesfully given &a%name of arg-2 parsed as a player% &2all the keys &a%arg-4% &2times!"
  703. send "{@lobby} &2You have recieved all the keys &a%arg-4% &2times!" to arg-2 parsed as a player
  704.  
  705. else:
  706. send "{@lobby} &c%arg-3% &4is not a number!"
  707. else:
  708. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  709. loop {_list::*}:
  710. add 1 to {keys.%arg-2%.%loop-value%}
  711.  
  712. send "{@lobby} &2Succesfully given &a%name of arg-2 parsed as a player% &2all the keys!"
  713. send "{@lobby} &2You have recieved all the keys!" to arg-2 parsed as a player
  714. else:
  715. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  716. if contains({_list::*}, "%arg-3 to lower case%"):
  717. if arg-4 is set:
  718. if (arg-4 parsed as a number) is set:
  719.  
  720. add (arg-4 parsed as a number) to {keys.%arg-2%.%arg-3 to lower case%}
  721.  
  722. 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!"
  723. send "{@lobby} &2You have recieved the &a%arg-3 to lower case% &2key &a%arg-4% &2times!" to arg-2 parsed as a player
  724.  
  725. else:
  726. send "{@lobby} &c%arg-3% &4is not a number!"
  727. else:
  728. add 1 to {keys.%arg-2%.%arg-3 to lower case%}
  729.  
  730. send "{@lobby} &2Succesfully given &a%name of arg-2 parsed as a player% &2the &a%arg-3 to lower case% &2key!"
  731. send "{@lobby} &2You have recieved the &a%arg-3 to lower case% &2key!" to arg-2 parsed as a player
  732. else:
  733. send "{@lobby} &4The crate &c%arg-3 to lower case% &4doesn't exist!"
  734. else:
  735. send "{@lobby} &4You must give up a &ccrate&4!"
  736. else:
  737. send "{@lobby} &4The player &c%arg-2% &4is not online!"
  738. else:
  739. send "{@lobby} &4You must give up a &cplayer&4!"
  740.  
  741.  
  742.  
  743. else if arg-1 is "remove":
  744. if arg-2 is set:
  745. if arg-2 is "all":
  746. if arg-3 is set:
  747. if (arg-3 parsed as a number) is set:
  748. if arg-4 is set:
  749. if (arg-4 parsed as a player) is set:
  750. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  751. set {_num} to arg-3 parsed as a number
  752. loop {_list::*}:
  753. if {keys.%name of arg-4 parsed as a player%.%loop-value%}-{_num} >= 0:
  754. remove {_num} from {keys.%name of arg-4 parsed as a player%.%loop-value%}
  755. else:
  756. set {keys.%name of arg-4 parsed as a player%.%loop-value%} to 0
  757.  
  758. send "{@lobby} &2Succesfully removed &a%arg-3% &2from all the keys of &a%name of arg-4 parsed as a player%&2!"
  759. send "{@lobby} &2Removed &a%arg-3% &2from your keys!" to arg-4 parsed as a player
  760.  
  761. else:
  762. send "{@lobby} &4The player &c%arg-4% &4is not online!"
  763. else:
  764. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  765. loop {_list::*}:
  766. if {keys.%player%.%loop-value%}-(arg-3 parsed as a number) >= 0:
  767. remove (arg-3 parsed as a number) from {keys.%player%.%loop-value%}
  768. else:
  769. set {keys.%player%.%loop-value%} to 0
  770.  
  771. send "{@lobby} &2Succesfully removed &a%arg-3% &2from all the keys!"
  772.  
  773. else:
  774. send "{@lobby} &c%arg-3% &4is not a number!"
  775. else:
  776. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  777. loop {_list::*}:
  778. if {keys.%player%.%loop-value%}-1 >= 0:
  779. remove 1 from {keys.%player%.%loop-value%}
  780.  
  781. send "{@lobby} &2Succesfully removed &a1 &2from all the keys"
  782. else:
  783. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  784. if contains({_list::*}, "%arg-2 to lower case%"):
  785. if arg-3 is set:
  786. if (arg-3 parsed as a number) is set:
  787. if arg-4 is set:
  788. if (arg-4 parsed as a player) is set:
  789. if {keys.%name of arg-4 parsed as a player%.%arg-2 to lower case%}-(arg-3 parsed as a number) >= 0:
  790. remove (arg-3 parsed as a number) from {keys.%name of arg-4 parsed as a player%.%arg-2 to lower case%}
  791. else:
  792. set {keys.%name of arg-4 parsed as a player%.%arg-2 to lower case%} to 0
  793.  
  794. send "{@lobby} &2Succesfully removed &a%arg-3% %arg-2 to lower case% &2keys from &a%name of arg-4 parsed as a player%&2!"
  795. send "{@lobby} &a%arg-3% %arg-2 to lower case% &2keys have been removed!" to arg-4 parsed as a player
  796.  
  797. else:
  798. send "{@lobby} &4The player &c%arg-4% &4is not online!"
  799. else:
  800.  
  801. if {keys.%player%.%arg-2 to lower case%}-(arg-3 parsed as a number) >= 0:
  802. remove (arg-3 parsed as a number) from {keys.%player%.%arg-2 to lower case%}
  803. send "{@lobby} &2Succesfully removed &a%arg-3% %arg-2 to lower case% &2keys!"
  804.  
  805. else:
  806. send "{@lobby} &c%arg-3% &4is not a number!"
  807.  
  808. else:
  809. if {keys.%player%.%arg-2 to lower case%}-1 >= 0:
  810. remove 1 from {keys.%player%.%arg-2 to lower case%}
  811. send "{@lobby} &2Succesfully removed &a1 %arg-2 to lower case% &2keys!"
  812. else:
  813. send "{@lobby} &4The crate &c%arg-2 to lower case% &4doesn't exist."
  814. else:
  815. send "{@lobby} &4You must give up a &ccrate&4!"
  816.  
  817. #send "&e&o/%{cmd}% clear <all/crate> [player] &d→ &fClear the keys from a player"
  818. else if arg-1 is "clear":
  819. if arg-2 is set:
  820. if arg-2 is "all":
  821. if arg-3 is set:
  822. if (arg-3 parsed as a player) is set:
  823. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  824. loop {_list::*}:
  825. set {keys.%name of arg-3 parsed as a player%.%loop-value%} to 0
  826.  
  827. send "{@lobby} &2Succesfully cleared &aall keys &2of &a%name of arg-3 parsed as a player%&2!"
  828. send "{@lobby} &aAll &2your &akeys &2have been cleared!" to arg-3 parsed as a player
  829. else:
  830. send "{@lobby} &4The player &c%arg-3% &4is not online!"
  831. else:
  832. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  833. loop {_list::*}:
  834. set {keys.%player%.%loop-value%} to 0
  835.  
  836. send "{@lobby} &2You have cleared &aall &2your &akeys&2!"
  837. else:
  838. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  839. if contains({_list::*}, "%arg-2 to lower case%"):
  840. if arg-3 is set:
  841. if (arg-3 parsed as a player) is set:
  842. set {keys.%name of arg-3 parsed as a player%.%arg-2 to lower case%} to 0
  843. send "{@lobby} &2You have cleared the &a%arg-2 to lower case% keys &2from &a%name of arg-3 parsed as a player%&2!"
  844. send "{@lobby} &2Your &a%arg-2 to lower case% keys &2have been cleared!" to arg-3 parsed as a player
  845.  
  846. else:
  847. send "{@lobby} &4The player &c%arg-3% &4is not online!"
  848.  
  849. else:
  850. set {keys.%player%.%arg-2 to lower case%} to 0
  851. send "{@lobby} &2Succesfully cleared the &a%arg-2 to lower case% keys&2!"
  852.  
  853. else:
  854. send "{@lobby} &4The crate &c%arg-2 to lower case% &4doesn't exist!"
  855. else:
  856. send "{@lobby} &4You must give up a &ccrate&4!"
  857.  
  858. #send "&e&o/%{cmd}% keys <all/crate> [player] &d→ &fGet the amount of keys from a player"
  859. else if arg-1 is "keys":
  860. if arg-2 is set:
  861. if arg-2 is "all":
  862. if arg-3 is set:
  863. if (arg-3 parsed as a player) is set:
  864. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  865. loop {_list::*}:
  866. if {keys.%name of arg-3 parsed as a player%.%loop-value%} is not set:
  867. set {keys.%name of arg-3 parsed as a player%.%loop-value%} to 0
  868.  
  869. if {_keys} is not set:
  870. set {_keys} to "&2%loop-value%: &a%{keys.%name of arg-3 parsed as a player%.%loop-value%}%"
  871. else:
  872. set {_keys} to "%{_keys}%%nl%&2%loop-value%: &a%{keys.%name of arg-3 parsed as a player%.%loop-value%}%"
  873.  
  874. send "{@lobby} &2This is the list of keys from &a%name of arg-3 parsed as a player%&2:%nl%%{_keys}%"
  875.  
  876. else:
  877. send "{@lobby} &4The player &c%arg-3% &4is not online!"
  878. else:
  879. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  880. loop {_list::*}:
  881. if {keys.%player%.%loop-value%} is not set:
  882. set {keys.%player%.%loop-value%} to 0
  883. if {_keys} is not set:
  884. set {_keys} to "&2%loop-value%: &a%{keys.%player%.%loop-value%}%"
  885. else:
  886. set {_keys} to "%{_keys}%%nl%&2%loop-value%: &a%{keys.%player%.%loop-value%}%"
  887.  
  888. send "{@lobby} &2This is your list of keys&2:%nl%%{_keys}%"
  889. else:
  890. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  891. if contains({_list::*}, "%arg-2 to lower case%"):
  892. if arg-3 is set:
  893. if (arg-3 parsed as a player) is set:
  894. if {keys.%name of arg-3 parsed as a player%.%arg-2 to lower case%} is not set:
  895. set {keys.%name of arg-3 parsed as a player%.%arg-2 to lower case%} to 0
  896.  
  897. 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."
  898.  
  899. else:
  900. send "{@lobby} &4The player &c%arg-3% &4is not online!"
  901. else:
  902. if {keys.%player%.%arg-2 to lower case%} is not set:
  903. set {keys.%player%.%arg-2 to lower case%} to 0
  904.  
  905. send "{@lobby} &2You have &a%{keys.%player%.%arg-2 to lower case%}% %arg-2 to lower case% &2keys."
  906. else:
  907. send "{@lobby} &4The crate &c%arg-2 to lower case% &4doesn't exist!"
  908. else:
  909. send "{@lobby} &4You need to give up a &ccrate&4!"
  910. else:
  911. send "{@lobby} &4Do &c/%{cmd}% help &4for more info!"
  912. else:
  913. send "{@lobby} &4Do &c/%{cmd}% help &4for more info!"
  914. #Detect if world is same
  915. #Detect if key exists
  916. #Give player key is he has permission
  917. #When everything works -> upload it on SkUnity!!!!! :DDD
Add Comment
Please, Sign In to add comment