Zeldaboy111

Skript #259 - Lobby

Nov 4th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.31 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 &e%uncolored name of player's tool% &2Crate!"
  203.  
  204. on break of chest:
  205. set {_world} to world of event-block
  206. if {_world} is "%world of {lobby.location}%":
  207. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  208. loop {_list::*}:
  209. loop {lobbycrate.%loop-value-1%.location::*}:
  210. if "%loop-value-2%" is "%location of event-block%":
  211. remove location of event-block from {lobbycrate.%uncolored name of player's tool%.location::*}
  212. send "{@lobby} &2Succesfully removed a &e%loop-value-1% &2Crate!"
  213.  
  214.  
  215.  
  216. on rightclick on a chest:
  217. set {_world} to world of clicked block
  218. if {_world} is "%world of {lobby.location}%":
  219. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  220. loop {_list::*}:
  221.  
  222. loop {lobbycrate.%loop-value-1%.location::*}:
  223. if "%loop-value-2%" is "%location of clicked block%":
  224. cancel event
  225. stop loop
  226.  
  227.  
  228. #------------------- Commands -------------------
  229. command /lobby [<text>] [<text>]:
  230. aliases: /hub
  231. trigger:
  232. if player has permission "lobby.*":
  233. if arg-1 is set:
  234. if arg-1 is "help":
  235. send "&2----------[ &a%{cmd}% &2]----------"
  236. send "&e&o/%{cmd}% help &d→ &fGet the help page"
  237. send "&e&o/%{cmd}% set &d→ &fSet the lobby"
  238. send "&2----------[ &a%{cmd}% &2]----------"
  239.  
  240. else if arg-1 is "set":
  241. send "{@logo} &2Succesfully set the &a%{cmd}% &2to your location!"
  242. set {lobby.location} to location of player
  243.  
  244. else:
  245. if {lobby.location} is set:
  246. if world of player is not "%world of {lobby.location}%":
  247. teleport player to {lobby.location}
  248. send "{@lobby} &fThe player %player% went to the lobby!" to all players in world of player
  249. clear player's inventory
  250. set slot 4 of player to a compass named "{@lcompass}"
  251.  
  252. else:
  253. teleport player to {lobby.location}
  254.  
  255.  
  256. else:
  257. send "{@lobby} &cThe %{cmd}% is not set yet!"
  258.  
  259.  
  260. else if {lobby.location} is set:
  261. if world of player is not "%world of {lobby.location}%":
  262. teleport player to {lobby.location}
  263. send "{@lobby} &fThe player %player% went to the lobby!" to all players in world of player
  264. clear player's inventory
  265. set slot 4 of player to a compass named "{@lcompass}"
  266.  
  267. else:
  268. teleport player to {lobby.location}
  269.  
  270. else:
  271. send "{@lobby} &cThe %{cmd}% is not set yet!"
  272.  
  273.  
  274. command /lobbycompass [<text>] [<text>] [<text>]:
  275. aliases: /lcomp, /lcompass
  276. trigger:
  277. if player has permission "lobbycompass.*":
  278. if arg 1 is not set:
  279. send "{@lobby} &4Do &c&o/%{cmd}% help &4for more info."
  280.  
  281. else if arg 1 is set:
  282. if arg 1 is "help":
  283. send "&2----------[ &a%{cmd}% &2]----------"
  284. send "&e&o/%{cmd}% help &d→ &fKrijg help pagina"
  285. send "&e&o/%{cmd}% create <minigame> &d→ &fCreate a minigame"
  286. send "&e&o/%{cmd}% remove/delete <minigame> &d→ &fDelete a minigame"
  287. send "&e&o/%{cmd}% setspawn <minigame> &d→ &fSet the spawn of a minigame"
  288. send "&e&o/%{cmd}% slot <minigame> <number> &d→ &fSet the GUI slot of a minigame"
  289.  
  290. send "&e&o/%{cmd}% setname <minigame> <name> &d→ &fSet a name"
  291. send "&e&o/%{cmd}% deletename <minigame> &d→ &fDelete the name of a minigame"
  292. send "&e&o/%{cmd}% setlore <minigame> <lore> &d→ &fSet a lore"
  293. send "&e&o/%{cmd}% deletelore <minigame> <minigame> &d→ &fDelete the lore of a minigame"
  294. send "&e&o/%{cmd}% setitem <minigame> <item> &d→ &fSet the item of a minigame"
  295. send "&e&o/%{cmd}% list &d→ &fGet a list of all the minigames"
  296. send "&e&o/%{cmd}% setrows <number> &d→ &fSet the amount of rows in the GUI"
  297. send "&e&o/%{cmd}% gui <minigame> &d→ &fOpen the config-GUI"
  298. send "&2----------[ &a%{cmd}% &2]----------"
  299.  
  300. else if arg 1 is "create":
  301. if arg 2 is set:
  302. if {lobby.minigames.%arg 2%} is not set:
  303. set {lobby.minigames.%arg 2%} to true
  304. set {lobby.minigames.%arg 2%.name} to "&cNone"
  305. set {lobby.minigames.%arg 2%.lore} to "&cNone"
  306. set {lobby.minigames.%arg 2%.item} to "&cNone"
  307. set {lobby.minigames.%arg 2%.slot} to "&cNone"
  308. set {lobby.minigames.%arg 2%.spawn} to "&cNone"
  309. add arg 2 to {lobby.minigames.list::*}
  310.  
  311. send "{@lobby} &2Succesfully made the minigame &a%arg 2%&2!"
  312.  
  313. else:
  314. send "{@lobby} &4The minigame &c%arg 2% &4already exists!"
  315. else:
  316. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1% <minigame>&4."
  317.  
  318. else if arg 1 is "delete" or "remove":
  319. if arg 2 is set:
  320. if {lobby.minigames.%arg 2%} is set:
  321. delete {lobby.minigames.%arg 2%}
  322. delete {lobby.minigames.%arg 2%.name}
  323. delete {lobby.minigames.%arg 2%.lore}
  324. delete {lobby.minigames.%arg 2%.item}
  325. delete {lobby.minigames.%arg 2%.slot}
  326. delete {lobby.minigames.%arg 2%.spawn}
  327. remove arg 2 from {lobby.minigames.list::*}
  328.  
  329. send "{@lobby} &2Succesfully removed the minigame &a%arg 2%&2!"
  330.  
  331. else:
  332. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  333. else:
  334. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
  335.  
  336.  
  337. else if arg 1 is "setspawn":
  338. if arg 2 is set:
  339. if {lobby.minigames.%arg 2%} is set:
  340. set {lobby.minigames.%arg 2%.spawn} to location of player
  341. send "{@lobby} &2Succesfully set the spawn of the minigame%nl%&a%arg 2% &2arg &a%location of player%&2!"
  342.  
  343. else:
  344. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  345. else:
  346. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
  347.  
  348. else if arg 1 is "slot":
  349. if arg 2 is set:
  350. if {lobby.minigames.%arg 2%} is set:
  351. if arg 3 is set:
  352. if (arg 3 parsed as a number) is set:
  353. if {lobby.compassRows} is not set:
  354. set {lobby.compassRows} to 1
  355.  
  356. if {lobby.compassRows} < 1:
  357. set {lobby.compassRows} to 1
  358.  
  359.  
  360. if {lobby.compassRows}*9-1 < arg-3 parsed as a number:
  361. send "{@lobby} &4The amount &c%arg 3% &4is to large bacause the max amount of slots is &c%{lobby.compassRows}*9+1%&4!"
  362.  
  363. else:
  364. loop {lobby.minigames.list::*}:
  365. if {lobby.minigames.%loop-value%.slot} is arg 3:
  366. set {_set} to loop-value
  367. stop loop
  368.  
  369. if {_set} is set:
  370. send "{@lobby} &4The slot &c%arg 3% &4is already in use by the minigame &c%{_set}%&4!"
  371. else:
  372. set {lobby.minigames.%arg 2%.slot} to arg 3
  373. send "{@lobby} &2Succesfully set the slot of the minigame &a%arg 2% &2to &a%arg 3%&2!"
  374. else:
  375. send "{@lobby} &c%arg 3% &4is not a number!"
  376. else:
  377. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <number>&4."
  378. else:
  379. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  380. else:
  381. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame> <number>&4."
  382.  
  383.  
  384. else if arg 1 is "setname":
  385. if arg 2 is set:
  386. if {lobby.minigames.%arg 2%} is set:
  387. if arg 3 is set:
  388. set {lobby.minigames.%arg 2%.name} to arg 3
  389. send "{@lobby} &2Succesfully set the name of the minigame &a%arg 2% &2to &a%arg 3%&2!"
  390.  
  391. else:
  392. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <name>&4."
  393. else:
  394. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  395. else:
  396. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <name>&4."
  397.  
  398. else if arg 1 is "delname" or "deletename":
  399. if arg 2 is set:
  400. delete {lobby.minigames.%arg 2%.name}
  401. send "{@lobby} &2Succesfully deleted the name from the minigame &a%arg 2%&2!"
  402.  
  403. else:
  404. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
  405.  
  406. else if arg 1 is "setlore":
  407. if arg 2 is set:
  408. if {lobby.minigames.%arg 2%} is set:
  409. if arg 3 is set:
  410. set {lobby.minigames.%arg 2%.lore} to arg 3
  411. send "{@lobby} &2Succesfully set the lore of the minigame &a%arg 2% &2to &a%arg 3%&2!"
  412.  
  413. else:
  414. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <lore>&4."
  415. else:
  416. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  417. else:
  418. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame> <lore>&4."
  419.  
  420. else if arg 1 is "dellore" or "deletelore":
  421. if arg 2 is set:
  422. if {lobby.minigames.%arg 2%} is set:
  423. delete {lobby.minigames.%arg 2%.lore}
  424. send "{@lobby} &2Succesfully deleted the lore from the minigame &a%arg 2%&2!"
  425.  
  426. else:
  427. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  428. else:
  429. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <name>&4."
  430.  
  431. else if arg 1 is "setitem":
  432. if arg 2 is set:
  433. if {lobby.minigames.%arg 2%} is set:
  434. if arg 3 is set:
  435. if (arg 3 parsed as an item) is set:
  436. set {lobby.minigames.%arg 2%.item} to arg 3 parsed as an item
  437. send "{@lobby} &2Succesfully set the item from the minigame &a%arg 2% &2to &a%arg 3%&2!"
  438.  
  439. else:
  440. send "{@lobby} &c%arg 3% &4is not an item!"
  441. else:
  442. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <item>&4."
  443. else:
  444. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  445. else:
  446. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame> <item>&4."
  447.  
  448.  
  449. else if arg 1 is "list":
  450.  
  451.  
  452.  
  453. if {lobby.minigames.list::*} is not empty:
  454. loop {lobby.minigames.list::*}:
  455. if {_list} is set:
  456. set {_list} to "%{_list}%&2, &a%loop-value%"
  457. else:
  458. set {_list} to "%loop-value%"
  459.  
  460.  
  461. else:
  462. set {_list} to "Geen"
  463.  
  464. send "{@lobby} &2This is the list of all the minigames:%nl%&a%{_list}%"
  465.  
  466.  
  467. else if arg 1 is "setrows":
  468. if arg 2 is set:
  469. if (arg 2 parsed as a number) is set:
  470. if (arg-2 parsed as a number) < 7:
  471. set {lobby.compassRows} to (arg-2 parsed as a number)
  472. send "{@lobby} &2Succesfully set the amount of rows to &a%arg 2%&2!"
  473.  
  474. else:
  475. send "{@lobby} &4The max amount of rows is &c6&4!"
  476. else:
  477. send "{@lobby} &c%arg 2% &4is not a number!"
  478. else:
  479. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <number>&4."
  480.  
  481.  
  482. else if arg 1 is "gui":
  483. if arg 2 is set:
  484. if {lobby.minigames.%arg 2%} is set:
  485. open chest with 2 rows named "&7Config GUI" to player
  486.  
  487. set {_name} to {lobby.minigames.%arg 2%.name}
  488. replace "&" in {_name} with "§"
  489.  
  490. set {_lore} to {lobby.minigames.%arg 2%.lore}
  491. replace "&" in {_lore} with "§"
  492.  
  493.  
  494. format gui slot 2 of player with a book named "&2Minigame: &a%arg 2%" to do nothing
  495. format gui slot 3 of player with a name tag named "&2Name: &f%{_name}%" to close then run function changeName(player, "%arg 2%")
  496. format gui slot 4 of player with a paper named "&2Lore: &f%{_lore}%" to close then run function changeLore(player, "%arg 2%")
  497. 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%")
  498. 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%")
  499.  
  500. 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%")
  501. format gui slot 13 of player with a barrier named "&cClose menu" to close
  502. format gui slot 14 of player with redstone named "&4Delete" to close then run function deleteMinigame(player, "%arg 2%")
  503.  
  504.  
  505. else:
  506. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  507. else:
  508. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
  509. else:
  510. send "{@lobby} &4Do &c/%{cmd}% help &4for more info."
  511.  
  512. command /lobbycrate [<text>] [<text>]:
  513. aliases: /lobbycr, /lcrate
  514. trigger:
  515. if player is in world of {lobby.location}:
  516. if player has permission "votecrate.*":
  517. if arg-1 is set:
  518. if arg-1 is "help":
  519. send "&2----------[ &a%{cmd}% &2]----------"
  520. send "&e&o/%{cmd}% help &d→ &fGet the halp page"
  521. send "&e&o/%{cmd}% list &d→ &fGet a list with all crates"
  522. send "&e&o/%{cmd}% create <crate> &d→ &fCreate a create"
  523. send "&e&o/%{cmd}% delete/remove <crate> &d→ &fDelete a crate"
  524. send "&e&o/%{cmd}% path <crate> &d→ &fGet the edit path of a crate"
  525. send "&e&o/%{cmd}% get <crate> &d→ &fGet a crate"
  526. send "&2----------[ &a%{cmd}% &2]----------"
  527.  
  528. else if arg-1 is "list":
  529. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  530. if {_list::*} is not empty:
  531. loop {_list::*}:
  532. if {_list} is set:
  533. set {_list} to "%{_list}%&2, &a%loop-value%"
  534. else:
  535. set {_list} to "%loop-value%"
  536.  
  537. send "{@lobby} &2There are the following crates:%nl%&a%{_list}%"
  538.  
  539. else:
  540. send "{@lobby} &2There are no crates made yet."
  541.  
  542.  
  543. else if arg-1 is "create":
  544. if arg-2 is set:
  545. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  546. set {_arg2} to "%arg-2 to lower case%"
  547. if contains({_list::*}, {_arg2}):
  548. send "{@lobby} &4The crate &c%{_arg2}% &4already exists!"
  549.  
  550.  
  551. else:
  552.  
  553. send "{@lobby} &2Making the crate &a%{_arg2}%&2..."
  554. add {_arg2} to yml list "Lobby.Crates.List" of file "{@config}"
  555. create file "{@path}/%{_arg2}%.yml"
  556. load "{@path}/%{_arg2}%.yml" as "{@path}/%{_arg2}%.yml"
  557. add "Be sure to not use names multiple times at Item.ConfigName!!!" to yml list "Item.Info" of file "{@path}/%{_arg2}%.yml"
  558. add "Chances must be 100 in total (Item.Chances)" to yml list "Item.Info" of file "{@path}/%{_arg2}%.yml"
  559.  
  560.  
  561. add "diamond_sword" to yml list "Item.List" of file "{@path}/%{_arg2}%.yml"
  562. add "diamond_sword-1" to yml list "Item.ConfigName" of file "{@path}/%{_arg2}%.yml"
  563.  
  564. set yml value "Item.Chance.diamond_sword-1" of file "{@path}/%{_arg2}%.yml" to "100"
  565. add "Diamond Sword" to yml list "Item.Name.diamond_sword-1" of file "{@path}/%{_arg2}%.yml"
  566. add "sharpness:1" to yml list "Item.Enchants.diamond_sword-1" of file "{@path}/%{_arg2}%.yml"
  567.  
  568. send "{@lobby} &2Succesfully made the crate &a%{_arg2}%&2!"
  569.  
  570.  
  571. else:
  572. send "{@lobby} &4You need to give up a &cname &4for the crate!"
  573.  
  574. else if arg-1 is "delete" or "remove":
  575. if arg-2 is set:
  576. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  577. set {_arg2} to "%arg-2 to lower case%"
  578. if contains({_list::*}, {_arg2}):
  579. send "{@lobby} &2Deleting the crate &a%{_arg2}%&2..."
  580.  
  581. remove "%{_arg2}%" from yml list "Lobby.Crates.List" of file "{@config}"
  582. delete file "{@path}/%{_arg2}%.yml"
  583.  
  584. send "{@lobby} &2Succesfully deleted the crate &a%{_arg2}%&2!"
  585.  
  586. else:
  587. send "{@lobby} &4The crate &c%{_arg2}% &4doesn't exist!"
  588.  
  589.  
  590.  
  591.  
  592. else:
  593. send "{@lobby} &4You need to give up a &cname &4of the crate you want to delete!"
  594.  
  595. else if arg-1 is "path":
  596. if arg-2 is set:
  597. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  598. set {_arg2} to "%arg-2 to lower case%"
  599. #if {_list::*} contains not {_arg2}:
  600. if contains({_list::*}, {_arg2}):
  601. send "{@lobby} &2Location of %{_arg2}%: &a{@path}/%{_arg2}%&2."
  602.  
  603.  
  604. else:
  605. send "{@lobby} &4The crate &c%{_arg2}% &4doesn't exists!"
  606. else:
  607. send "{@lobby} &4You need to give up a &cname &4of the crate you want to get the path of!"
  608.  
  609. else if arg-1 is "get":
  610. if arg 2 is set:
  611. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  612. set {_arg2} to "%arg-2 to lower case%"
  613. if contains({_list::*}, {_arg2}):
  614. send "{@lobby} &2Here you have the &a%{_arg2}% &2crate!%nl%&2Place it to create a chest."
  615. give player 1 chest named "&e%{_arg2}%" with lore "&7Place to create a crate!"
  616. else:
  617. send "{@lobby} &4The crate &c%{_arg2}% &4doesn't exist!"
  618. else:
  619. send "{@lobby} &4You must give up a crate type!"
  620.  
  621. else:
  622. send "{@lobby} &4Do &c/%{cmd}% help &4for more info."
  623. else:
  624. send "{@lobby} &4Do &c/%{cmd}% help &4for more info."
  625.  
  626.  
  627. command /key [<text>] [<text>] [<text>] [<text>]:
  628. trigger:
  629. if player has permission "key.*":
  630. if arg-1 is set:
  631. if arg-1 is "help":
  632. send "&2----------[ &a%{cmd}% &2]----------"
  633. send "&e&o/%{cmd}% help &d→ &fGet the halp page"
  634. send "&e&o/%{cmd}% get <crate/all> [number] &d→ &fGet a crate"
  635. send "&e&o/%{cmd}% give <player> <crate/all> [number] &d→ &fGive a key to open a crate to a player"
  636. #Remove all/key [number] [player]
  637. #Clear all/key [player]
  638. #Keys [player]
  639. send "&2----------[ &a%{cmd}% &2]----------"
  640.  
  641. else if arg-1 is "get":
  642. if arg-2 is "all":
  643. if arg-3 is set:
  644. if (arg-3 parsed as a number) is set:
  645. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  646. set {_num} to arg-3 parsed as a number
  647. loop {_num} times:
  648. loop {_list::*}:
  649. add 1 to {keys.%player%.%loop-value-2%}
  650.  
  651. send "{@lobby} &2You have recieved all the &a%arg-3% &2times!"
  652.  
  653. else:
  654. send "{@lobby} &c%arg-3% &4is not a number!"
  655. else:
  656. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  657. loop {_list::*}:
  658. add 1 to {keys.%player%.%loop-value%}
  659.  
  660. send "{@lobby} &2You have recieved all keys!"
  661.  
  662. else if arg-2 is set:
  663. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  664. if contains({_list::*}, "%arg-2 to lower case%"):
  665. if arg-3 is set:
  666. if (arg-3 parsed as a number) is set:
  667. add (arg-3 parsed as a number) to {keys.%player%.%arg-2 to lower case%}
  668. send "{@lobby} &2You have recieved &a%arg-2 to lower case% &2key &a%arg-3% &2times!"
  669. else:
  670. send "{@lobby} &c%arg-3% &4is not a number!"
  671. else:
  672. add 1 to {keys.%player%.%arg-2 to lower case%}
  673.  
  674. send "{@lobby} &2You have recieved a &a%arg-2 to lower case% &2key!"
  675. else:
  676. send "{@lobby} &4The crate &c%arg-2 to lower case% &4doesn't exist."
  677. else:
  678. send "{@lobby} &4You must give up a &ccrate&4!"
  679.  
  680. else if arg-1 is "give":
  681. if arg-2 is set:
  682. if (arg-2 parsed as a player) is set:
  683. if arg-3 is set:
  684. if arg-3 is "all":
  685. if arg-4 is set:
  686. if (arg-4 parsed as a number) is set:
  687. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  688. set {_num} to arg-4 parsed as a number
  689. loop {_num} times:
  690. loop {_list::*}:
  691. add 1 to {keys.%arg-2%.%loop-value-2%}
  692.  
  693. send "{@lobby} &2Succesfully given &a%arg-2% &2all the keys &a%arg-4% &2times!"
  694. send "{@lobby} &2You have recieved all the keys &a%arg-4% &2times!" to arg-2 parsed as a player
  695.  
  696. else:
  697. send "{@lobby} &c%arg-3% &4is not a number!"
  698. else:
  699. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  700. loop {_list::*}:
  701. add 1 to {keys.%arg-2%.%loop-value%}
  702.  
  703. send "{@lobby} &2Succesfully given &a%arg-2% &2all the keys!"
  704. send "{@lobby} &2You have recieved all the keys!" to arg-2 parsed as a player
  705. else:
  706. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  707. if contains({_list::*}, "%arg-3 to lower case%"):
  708. if arg-4 is set:
  709. if (arg-4 parsed as a number) is set:
  710.  
  711. add (arg-4 parsed as a number) to {keys.%arg-2%.%arg-3 to lower case%}
  712.  
  713. send "{@lobby} &2Succesfully given &a%arg-2% &2the &a%arg-3 to lower case% &2key &a%arg-4% &2times!"
  714. send "{@lobby} &2You have recieved the &a%arg-3 to lower case% &2key &a%arg-4% &2times!" to arg-2 parsed as a player
  715.  
  716. else:
  717. send "{@lobby} &c%arg-3% &4is not a number!"
  718. else:
  719. add 1 to {keys.%arg-2%.%arg-3 to lower case%}
  720.  
  721. send "{@lobby} &2Succesfully given &a%arg-2% &2the &a%arg-3 to lower case% &2key!"
  722. send "{@lobby} &2You have recieved the &a%arg-3 to lower case% &2key!" to arg-2 parsed as a player
  723. else:
  724. send "{@lobby} &4The crate &c%arg-3 to lower case% &4doesn't exist!"
  725. else:
  726. send "{@lobby} &4You must give up a &ccrate&4!"
  727. else:
  728. send "{@lobby} &4The player &c%arg-2% &4has never logged in!"
  729. else:
  730. send "{@lobby} &4You must give up a &cplayer&4!"
  731. else:
  732. send "{@lobby} &4Do &c/%{cmd}% help &4for more info!"
  733. else:
  734. send "{@lobby} &4Do &c/%{cmd}% help &4for more info!"
  735. #Detect if world is same
  736. #Detect if key exists
  737. #Give player key is he has permission
  738. #When everything works -> upload it on SkUnity!!!!! :DDD
Add Comment
Please, Sign In to add comment