Advertisement
Zeldaboy111

Skript #258 - Crates (1)

Nov 3rd, 2019
1,240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.75 KB | None | 0 0
  1. options:
  2. logo: &6Server &7▬ &2
  3. lobby: &cLobby &7► &2
  4. lcompass: &9C&3ompass
  5. cGuiName: &9M&3inigames
  6. path: Files/Lobby
  7. config: Files/Lobby/config.yml
  8.  
  9.  
  10. #alt + 15 = ☼
  11. #alt + 26 = →
  12. #alt + 16 = ►
  13. #alt + 22 = ▬
  14.  
  15. #------------------- Functions -------------------
  16. function openCompass(p: Player):
  17. if {lobby.compassRows} is not set:
  18. set {lobby.compassRows} to 1
  19.  
  20. open chest with {lobby.compassRows} rows named "{@cGuiName}" to {_p}
  21.  
  22. loop {lobby.minigames.list::*}:
  23. if {lobby.minigames.%loop-value%.slot} starts with "-":
  24. stop
  25. else:
  26. if ({lobby.minigames.%loop-value%.slot} parsed as a number) is set:
  27.  
  28. if {lobby.minigames.%loop-value%.item} is "&cNone":
  29. set {_item} to paper
  30.  
  31. else if ({lobby.minigames.%loop-value%.item} parsed as an item) is not set:
  32. set {_item} to paper
  33.  
  34. else:
  35. set {_item} to {lobby.minigames.%loop-value%.item}
  36.  
  37.  
  38. set {_slot} to ({lobby.minigames.%loop-value%.slot} parsed as a number)
  39.  
  40. if {lobby.minigames.%loop-value%.name} is set:
  41. if {lobby.minigames.%loop-value%.name} is not "&cNone":
  42. set {_name} to {lobby.minigames.%loop-value%.name}
  43. replace "&" in {_name} with "§"
  44. if {lobby.minigames.%loop-value%.lore} is set:
  45. if {lobby.minigames.%loop-value%.lore} is not "&cNone":
  46. set {_lore} to {lobby.minigames.%loop-value%.lore}
  47. replace "&" in {_lore} with "§"
  48. format gui slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item named "%{_name}%" with lore "%{_lore}%" to do nothing
  49. else:
  50. format gui slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item named "%{_name}%" to do nothing
  51. else:
  52. format gui slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item named "%{_name}%" to do nothing
  53. else:
  54. format gui slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item to do nothing
  55. else:
  56. format gui slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item to do nothing
  57.  
  58.  
  59. function changeName(p: Player, s: String):
  60. open chest with 3 rows named "&4Name &c%{_s}%" to {_p}
  61.  
  62. format gui slot 12 of {_p} with green_wool named "&aChange" to run:
  63. close {_p}'s inventory
  64. send "{@lobby} &2Click <suggest command:/lcompass setname %{_s}% [naam]>&ahere<reset> &2to edit the name." to {_p}
  65.  
  66.  
  67. format gui slot 14 of {_p} with red_wool named "&cDeny" to run:
  68. close {_p}'s inventory
  69. send "{@lobby} &4You have chosen to give the minigame%nl%&c%{_s}% &4not an other name." to {_p}
  70.  
  71. function changeLore(p: Player, s: String):
  72. open chest with 3 rows named "&4Lore &c%{_s}%" to {_p}
  73.  
  74. format gui slot 12 of {_p} with green_wool named "&aChange" to run:
  75. close {_p}'s inventory
  76. send "{@lobby} &2Click <suggest command:/lcompass setlore %{_s}% [lore]>&ahere<reset> &2to edit the lore." to {_p}
  77.  
  78. format gui slot 14 of {_p} with red_wool named "&cDeny" to run:
  79. close {_p}'s inventory
  80. send "{@lobby} &4You have chosen to give the minigame%nl%&c%{_s}% &4not an other lore." to {_p}
  81.  
  82. function changeItem(p: Player, s: String):
  83. open chest with 3 rows named "&4Item &c%{_s}%" to {_p}
  84.  
  85. format gui slot 12 of {_p} with green_wool named "&aChange" to run:
  86. close {_p}'s inventory
  87. send "{@lobby} &2Click <suggest command:/lcompass setitem %{_s}% [item]>&ahere<reset> &2to edit the item." to {_p}
  88.  
  89. format gui slot 14 of {_p} with red_wool named "&cDeny" to run:
  90. close {_p}'s inventory
  91. send "{@lobby} &4You have chosen to give the minigame%nl%&c%{_s}% &4not an other item." to {_p}
  92.  
  93. function setSlot(p: Player, s: String):
  94. open chest with 3 rows named "&4Slot &c%{_s}%" to {_p}
  95.  
  96. format gui slot 12 of {_p} with green_wool named "&aChange" to run:
  97. close {_p}'s inventory
  98. send "{@lobby} &2Click <suggest command:/lcompass slot %{_s}% [slot]>&ahere<reset> &2to edit the slot." to {_p}
  99.  
  100. format gui slot 14 of {_p} with red_wool named "&cDeny" to run:
  101. close {_p}'s inventory
  102. send "{@lobby} &4You have chosen to give the minigame%nl%&c%{_s}% &4not an other slot." to {_p}
  103.  
  104.  
  105. function setSpawn(p: Player, s: String):
  106. open chest with 3 rows named "&4Spawn &c%{_s}%" to {_p}
  107.  
  108. format gui slot 12 of {_p} with green_wool named "&aSet spawn" to run:
  109. close {_p}'s inventory
  110. send "{@lobby} &2Click <command:/lcompass setspawn %{_s}%>&ahere<reset> &2to set the spawn." to {_p}
  111.  
  112. format gui slot 14 of {_p} with red_wool named "&cDeny" to run:
  113. close {_p}'s inventory
  114. send "{@lobby} &4You have chosen to give the minigame%nl%&c%{_s}% &4not an other spawn." to {_p}
  115.  
  116.  
  117. function deleteMinigame(p: Player, s: String):
  118. open chest with 3 rows named "&4Delete &c%{_s}%" to {_p}
  119.  
  120. format gui slot 12 of {_p} with green_wool named "&aAccept" to run:
  121. close {_p}'s inventory
  122. execute player command "/lcompass delete %{_s}%"
  123.  
  124. format gui slot 14 of {_p} with red_wool named "&cDeny" to run:
  125. close {_p}'s inventory
  126. send "{@lobby} &4Je hebt ervoor gekozen om de minigame%nl%&c%{_s}% &4niet te verwijderen." to {_p}
  127.  
  128. function contains(list: objects, check: object) :: boolean:
  129. loop {_list::*}:
  130. if loop-value is {_check}:
  131. return true
  132. return false
  133.  
  134. #------------------- Periotic Events -------------------
  135.  
  136.  
  137.  
  138.  
  139.  
  140. #------------------- Events -------------------
  141. on enable:
  142. if file "{@config}" doesn't exist:
  143. create file "{@config}"
  144.  
  145.  
  146. on join:
  147. if {lobby.location} is set:
  148. teleport player to {lobby.location}
  149. set join message to ""
  150. wait 10 ticks
  151.  
  152. clear player's inventory
  153. send "{@lobby} &fThe player %player% has joined!" to all players in world of player
  154. set slot 4 of player to a compass named "{@lcompass}"
  155.  
  156.  
  157. on inventory click:
  158. if player is in world of {lobby.location}:
  159. if clicked item is a compass named "{@lcompass}":
  160. cancel event
  161. close player's inventory
  162. openCompass(player)
  163.  
  164. on click:
  165. if player is in world of {lobby.location}:
  166. if player's held item is a compass named "{@lcompass}":
  167. cancel event
  168. openCompass(player)
  169.  
  170.  
  171. on command:
  172. command is "plugins" or "pl":
  173. cancel event
  174.  
  175. if player is not op:
  176. stop
  177.  
  178. else:
  179. set {_list::*} to list of plugins
  180. set {_count} to 0
  181. loop {_list::*}:
  182. add 1 to {_count}
  183. send "{@logo} Plugin list:%nl%&f(&a%{_count}%&f) &2%list of plugins%"
  184.  
  185. else:
  186. set {cmd} to "%command to lower case%"
  187.  
  188. on place of chest:
  189. set {_world} to world of event-block
  190. if {_world} is "%world of {lobby.location}%":
  191. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  192. if contains({_list::*}, "%uncolored name of player's tool%"):
  193. add location of event-block to {lobbycrate.%uncolored name of player's tool%.location::*}
  194. send "{@lobby} &2Succesfully created a &e%uncolored name of player's tool% &2Crate!"
  195.  
  196. on break 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. loop {_list::*}:
  201. loop {lobbycrate.%loop-value-1%.location::*}:
  202. if "%loop-value-2%" is "%location of event-block%":
  203. remove location of event-block from {lobbycrate.%uncolored name of player's tool%.location::*}
  204. send "{@lobby} &2Succesfully removed a &e%loop-value-1% &2Crate!"
  205.  
  206.  
  207.  
  208. on rightclick on a chest:
  209. set {_world} to world of clicked block
  210. if {_world} is "%world of {lobby.location}%":
  211. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  212. loop {_list::*}:
  213.  
  214. loop {lobbycrate.%loop-value-1%.location::*}:
  215. if "%loop-value-2%" is "%location of clicked block%":
  216. cancel event
  217. stop loop
  218.  
  219.  
  220. #------------------- Commands -------------------
  221. command /lobby [<text>] [<text>]:
  222. aliases: /hub
  223. trigger:
  224. if player has permission "lobby.*":
  225. if arg-1 is set:
  226. if arg-1 is "help":
  227. send "&2----------[ &a%{cmd}% &2]----------"
  228. send "&e&o/%{cmd}% help &d→ &fGet the help page"
  229. send "&e&o/%{cmd}% set &d→ &fSet the lobby"
  230. send "&2----------[ &a%{cmd}% &2]----------"
  231.  
  232. else if arg-1 is "set":
  233. send "{@logo} &2Succesfully set the &a%{cmd}% &2to your location!"
  234. set {lobby.location} to location of player
  235.  
  236. else:
  237. if {lobby.location} is set:
  238. if world of player is not "%world of {lobby.location}%":
  239. teleport player to {lobby.location}
  240. send "{@lobby} &fThe player %player% went to the lobby!" to all players in world of player
  241. clear player's inventory
  242. set slot 4 of player to a compass named "{@lcompass}"
  243.  
  244. else:
  245. teleport player to {lobby.location}
  246.  
  247.  
  248. else:
  249. send "{@lobby} &cThe %{cmd}% is not set yet!"
  250.  
  251.  
  252. else if {lobby.location} is set:
  253. if world of player is not "%world of {lobby.location}%":
  254. teleport player to {lobby.location}
  255. send "{@lobby} &fThe player %player% went to the lobby!" to all players in world of player
  256. clear player's inventory
  257. set slot 4 of player to a compass named "{@lcompass}"
  258.  
  259. else:
  260. teleport player to {lobby.location}
  261.  
  262. else:
  263. send "{@lobby} &cThe %{cmd}% is not set yet!"
  264.  
  265.  
  266. command /lobbycompass [<text>] [<text>] [<text>]:
  267. aliases: /lcomp, /lcompass
  268. trigger:
  269. if player has permission "lobbycompass.*":
  270. if arg 1 is not set:
  271. send "{@lobby} &4Do &c&o/%{cmd}% help &4for more info."
  272.  
  273. else if arg 1 is set:
  274. if arg 1 is "help":
  275. send "&2----------[ &a%{cmd}% &2]----------"
  276. send "&e&o/%{cmd}% help &d→ &fKrijg help pagina"
  277. send "&e&o/%{cmd}% create <minigame> &d→ &fCreate a minigame"
  278. send "&e&o/%{cmd}% remove/delete <minigame> &d→ &fDelete a minigame"
  279. send "&e&o/%{cmd}% setspawn <minigame> &d→ &fSet the spawn of a minigame"
  280. send "&e&o/%{cmd}% slot <minigame> <number> &d→ &fSet the GUI slot of a minigame"
  281.  
  282. send "&e&o/%{cmd}% setname <minigame> <name> &d→ &fSet a name"
  283. send "&e&o/%{cmd}% deletename <minigame> &d→ &fDelete the name of a minigame"
  284. send "&e&o/%{cmd}% setlore <minigame> <lore> &d→ &fSet a lore"
  285. send "&e&o/%{cmd}% deletelore <minigame> <minigame> &d→ &fDelete the lore of a minigame"
  286. send "&e&o/%{cmd}% setitem <minigame> <item> &d→ &fSet the item of a minigame"
  287. send "&e&o/%{cmd}% list &d→ &fGet a list of all the minigames"
  288. send "&e&o/%{cmd}% setrows <number> &d→ &fSet the amount of rows in the GUI"
  289. send "&e&o/%{cmd}% gui <minigame> &d→ &fOpen the config-GUI"
  290. send "&2----------[ &a%{cmd}% &2]----------"
  291.  
  292. else if arg 1 is "create":
  293. if arg 2 is set:
  294. if {lobby.minigames.%arg 2%} is not set:
  295. set {lobby.minigames.%arg 2%} to true
  296. set {lobby.minigames.%arg 2%.name} to "&cNone"
  297. set {lobby.minigames.%arg 2%.lore} to "&cNone"
  298. set {lobby.minigames.%arg 2%.item} to "&cNone"
  299. set {lobby.minigames.%arg 2%.slot} to "&cNone"
  300. set {lobby.minigames.%arg 2%.spawn} to "&cNone"
  301. add arg 2 to {lobby.minigames.list::*}
  302.  
  303. send "{@lobby} &2Succesfully made the minigame &a%arg 2%&2!"
  304.  
  305. else:
  306. send "{@lobby} &4The minigame &c%arg 2% &4already exists!"
  307. else:
  308. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1% <minigame>&4."
  309.  
  310. else if arg 1 is "delete" or "remove":
  311. if arg 2 is set:
  312. if {lobby.minigames.%arg 2%} is set:
  313. delete {lobby.minigames.%arg 2%}
  314. delete {lobby.minigames.%arg 2%.name}
  315. delete {lobby.minigames.%arg 2%.lore}
  316. delete {lobby.minigames.%arg 2%.item}
  317. delete {lobby.minigames.%arg 2%.slot}
  318. delete {lobby.minigames.%arg 2%.spawn}
  319. remove arg 2 from {lobby.minigames.list::*}
  320.  
  321. send "{@lobby} &2Succesfully removed the minigame &a%arg 2%&2!"
  322.  
  323. else:
  324. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  325. else:
  326. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
  327.  
  328.  
  329. else if arg 1 is "setspawn":
  330. if arg 2 is set:
  331. if {lobby.minigames.%arg 2%} is set:
  332. set {lobby.minigames.%arg 2%.spawn} to location of player
  333. send "{@lobby} &2Succesfully set the spawn of the minigame%nl%&a%arg 2% &2arg &a%location of player%&2!"
  334.  
  335. else:
  336. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  337. else:
  338. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
  339.  
  340. else if arg 1 is "slot":
  341. if arg 2 is set:
  342. if {lobby.minigames.%arg 2%} is set:
  343. if arg 3 is set:
  344. if (arg 3 parsed as a number) is set:
  345. if {lobby.compassRows} is not set:
  346. set {lobby.compassRows} to 1
  347.  
  348. if {lobby.compassRows} < 1:
  349. set {lobby.compassRows} to 1
  350.  
  351.  
  352. if {lobby.compassRows}*9-1 < arg-3 parsed as a number:
  353. send "{@lobby} &4The amount &c%arg 3% &4is to large bacause the max amount of slots is &c%{lobby.compassRows}*9+1%&4!"
  354.  
  355. else:
  356. loop {lobby.minigames.list::*}:
  357. if {lobby.minigames.%loop-value%.slot} is arg 3:
  358. set {_set} to loop-value
  359. stop loop
  360.  
  361. if {_set} is set:
  362. send "{@lobby} &4The slot &c%arg 3% &4is already in use by the minigame &c%{_set}%&4!"
  363. else:
  364. set {lobby.minigames.%arg 2%.slot} to arg 3
  365. send "{@lobby} &2Succesfully set the slot of the minigame &a%arg 2% &2to &a%arg 3%&2!"
  366. else:
  367. send "{@lobby} &c%arg 3% &4is not a number!"
  368. else:
  369. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <number>&4."
  370. else:
  371. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  372. else:
  373. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame> <number>&4."
  374.  
  375.  
  376. else if arg 1 is "setname":
  377. if arg 2 is set:
  378. if {lobby.minigames.%arg 2%} is set:
  379. if arg 3 is set:
  380. set {lobby.minigames.%arg 2%.name} to arg 3
  381. send "{@lobby} &2Succesfully set the name of the minigame &a%arg 2% &2to &a%arg 3%&2!"
  382.  
  383. else:
  384. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <name>&4."
  385. else:
  386. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  387. else:
  388. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <name>&4."
  389.  
  390. else if arg 1 is "delname" or "deletename":
  391. if arg 2 is set:
  392. delete {lobby.minigames.%arg 2%.name}
  393. send "{@lobby} &2Succesfully deleted the name from the minigame &a%arg 2%&2!"
  394.  
  395. else:
  396. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
  397.  
  398. else if arg 1 is "setlore":
  399. if arg 2 is set:
  400. if {lobby.minigames.%arg 2%} is set:
  401. if arg 3 is set:
  402. set {lobby.minigames.%arg 2%.lore} to arg 3
  403. send "{@lobby} &2Succesfully set the lore of the minigame &a%arg 2% &2to &a%arg 3%&2!"
  404.  
  405. else:
  406. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <lore>&4."
  407. else:
  408. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  409. else:
  410. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame> <lore>&4."
  411.  
  412. else if arg 1 is "dellore" or "deletelore":
  413. if arg 2 is set:
  414. if {lobby.minigames.%arg 2%} is set:
  415. delete {lobby.minigames.%arg 2%.lore}
  416. send "{@lobby} &2Succesfully deleted the lore from the minigame &a%arg 2%&2!"
  417.  
  418. else:
  419. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  420. else:
  421. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <name>&4."
  422.  
  423. else if arg 1 is "setitem":
  424. if arg 2 is set:
  425. if {lobby.minigames.%arg 2%} is set:
  426. if arg 3 is set:
  427. if (arg 3 parsed as an item) is set:
  428. set {lobby.minigames.%arg 2%.item} to arg 3 parsed as an item
  429. send "{@lobby} &2Succesfully set the item from the minigame &a%arg 2% &2to &a%arg 3%&2!"
  430.  
  431. else:
  432. send "{@lobby} &c%arg 3% &4is not an item!"
  433. else:
  434. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <item>&4."
  435. else:
  436. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  437. else:
  438. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame> <item>&4."
  439.  
  440.  
  441. else if arg 1 is "list":
  442.  
  443.  
  444.  
  445. if {lobby.minigames.list::*} is not empty:
  446. loop {lobby.minigames.list::*}:
  447. if {_list} is set:
  448. set {_list} to "%{_list}%&2, &a%loop-value%"
  449. else:
  450. set {_list} to "%loop-value%"
  451.  
  452.  
  453. else:
  454. set {_list} to "Geen"
  455.  
  456. send "{@lobby} &2This is the list of all the minigames:%nl%&a%{_list}%"
  457.  
  458.  
  459. else if arg 1 is "setrows":
  460. if arg 2 is set:
  461. if (arg 2 parsed as a number) is set:
  462. if (arg-2 parsed as a number) < 7:
  463. set {lobby.compassRows} to (arg-2 parsed as a number)
  464. send "{@lobby} &2Succesfully set the amount of rows to &a%arg 2%&2!"
  465.  
  466. else:
  467. send "{@lobby} &4The max amount of rows is &c6&4!"
  468. else:
  469. send "{@lobby} &c%arg 2% &4is not a number!"
  470. else:
  471. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <number>&4."
  472.  
  473.  
  474. else if arg 1 is "gui":
  475. if arg 2 is set:
  476. if {lobby.minigames.%arg 2%} is set:
  477. open chest with 2 rows named "&7Config GUI" to player
  478.  
  479. set {_name} to {lobby.minigames.%arg 2%.name}
  480. replace "&" in {_name} with "§"
  481.  
  482. set {_lore} to {lobby.minigames.%arg 2%.lore}
  483. replace "&" in {_lore} with "§"
  484.  
  485.  
  486. format gui slot 2 of player with a book named "&2Minigame: &a%arg 2%" to do nothing
  487. format gui slot 3 of player with a name tag named "&2Name: &f%{_name}%" to close then run function changeName(player, "%arg 2%")
  488. format gui slot 4 of player with a paper named "&2Lore: &f%{_lore}%" to close then run function changeLore(player, "%arg 2%")
  489. 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%")
  490. 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%")
  491.  
  492. 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%")
  493. format gui slot 13 of player with a barrier named "&cClose menu" to close
  494. format gui slot 14 of player with redstone named "&4Delete" to close then run function deleteMinigame(player, "%arg 2%")
  495.  
  496.  
  497. else:
  498. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  499. else:
  500. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
  501. else:
  502. send "{@lobby} &4Do &c/%{cmd}% help &4for more info."
  503.  
  504. command /lobbycrate [<text>] [<text>]:
  505. aliases: /lobbycr, /lcrate
  506. trigger:
  507. if player is in world of {lobby.location}:
  508. if player has permission "votecrate.*":
  509. if arg-1 is set:
  510. if arg-1 is "help":
  511. send "&2----------[ &a%{cmd}% &2]----------"
  512. send "&e&o%{cmd}% help &d→ &fGet the halp page"
  513. send "&e&o%{cmd}% list &d→ &fGet a list with all crates"
  514. send "&e&o%{cmd}% create <crate> &d→ &fCreate a create"
  515. send "&e&o%{cmd}% delete/remove <crate> &d→ &fDelete a crate"
  516. send "&e&o%{cmd}% path <crate> &d→ &fGet the edit path of a crate"
  517. send "&e&o%{cmd}% get <crate> &d→ &fGet a crate"
  518. send "&2----------[ &a%{cmd}% &2]----------"
  519.  
  520. else if arg-1 is "list":
  521. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  522. if {_list::*} is not empty:
  523. loop {_list::*}:
  524. if {_list} is set:
  525. set {_list} to "%{_list}%&2, &a%loop-value%"
  526. else:
  527. set {_list} to "%loop-value%"
  528.  
  529. send "{@lobby} &2There are the following crates:%nl%&a%{_list}%"
  530.  
  531. else:
  532. send "{@lobby} &2There are no crates made yet."
  533.  
  534.  
  535. else if arg-1 is "create":
  536. if arg-2 is set:
  537. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  538. set {_arg2} to "%arg-2 to lower case%"
  539. if contains({_list::*}, {_arg2}):
  540. send "{@lobby} &4The crate &c%{_arg2}% &4already exists!"
  541.  
  542.  
  543. else:
  544.  
  545. send "{@lobby} &2Making the crate &a%{_arg2}%&2..."
  546. add {_arg2} to yml list "Lobby.Crates.List" of file "{@config}"
  547. create file "{@path}/%{_arg2}%.yml"
  548. load "{@path}/%{_arg2}%.yml" as "{@path}/%{_arg2}%.yml"
  549. add "Be sure to not use names multiple times at Item.ConfigName!!!" to yml list "Item.Info" of file "{@path}/%{_arg2}%.yml"
  550. add "Chances must be 100 in total (Item.Chances)" to yml list "Item.Info" of file "{@path}/%{_arg2}%.yml"
  551.  
  552.  
  553. add "diamond_sword" to yml list "Item.List" of file "{@path}/%{_arg2}%.yml"
  554. add "diamond_sword-1" to yml list "Item.ConfigName" of file "{@path}/%{_arg2}%.yml"
  555.  
  556. set yml value "Item.Chance.diamond_sword-1" of file "{@path}/%{_arg2}%.yml" to "100"
  557. add "Diamond Sword" to yml list "Item.Name.diamond_sword-1" of file "{@path}/%{_arg2}%.yml"
  558. add "sharpness:1" to yml list "Item.Enchants.diamond_sword-1" of file "{@path}/%{_arg2}%.yml"
  559.  
  560. send "{@lobby} &2Succesfully made the crate &a%{_arg2}%&2!"
  561.  
  562.  
  563. else:
  564. send "{@lobby} &4You need to give up a &cname &4for the crate!"
  565.  
  566. else if arg-1 is "delete" or "remove":
  567. if arg-2 is set:
  568. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  569. set {_arg2} to "%arg-2 to lower case%"
  570. #send "%{_list::*}% contians %{_arg2}%"
  571. #if {_list::*} contains not {_arg2}:
  572. if contains({_list::*}, {_arg2}):
  573. send "{@lobby} &2Deleting the crate &a%{_arg2}%&2..."
  574.  
  575. remove "%{_arg2}%" from yml list "Lobby.Crates.List" of file "{@config}"
  576. delete file "{@path}/%{_arg2}%.yml"
  577.  
  578. send "{@lobby} &2Succesfully deleted the crate &a%{_arg2}%&2!"
  579. #loop {_list::*}:
  580. #if "%loop-value%" is "%{_arg2}%":
  581. #stop loop
  582.  
  583. else:
  584. send "{@lobby} &4The crate &c%{_arg2}% &4doesn't exist!"
  585.  
  586.  
  587.  
  588.  
  589. else:
  590. send "{@lobby} &4You need to give up a &cname &4of the crate you want to delete!"
  591.  
  592. else if arg-1 is "path":
  593. if arg-2 is set:
  594. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  595. set {_arg2} to "%arg-2 to lower case%"
  596. #if {_list::*} contains not {_arg2}:
  597. if contains({_list::*}, {_arg2}):
  598. send "{@lobby} &2Location of %{_arg2}%: &a{@path}/%{_arg2}%&2."
  599.  
  600.  
  601. else:
  602. send "{@lobby} &4The crate &c%{_arg2}% &4doesn't exists!"
  603. else:
  604. send "{@lobby} &4You need to give up a &cname &4of the crate you want to get the path of!"
  605.  
  606. else if arg-1 is "get":
  607. if arg 2 is set:
  608. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  609. set {_arg2} to "%arg-2 to lower case%"
  610. if contains({_list::*}, {_arg2}):
  611. #if {_list::*} contains {_arg2}:
  612. send "{@lobby} &2Here you have the &a%{_arg2}% &2crate!%nl%&2Place it to create a chest."
  613. give player 1 chest named "&e%{_arg2}%" with lore "&7Place to create a crate!"
  614. else:
  615. send "{@lobby} &4The crate &c%{_arg2}% &4doesn't exist!"
  616. else:
  617. send "{@lobby} &4You must give up a crate type!"
  618.  
  619. else:
  620. send "{@lobby} &4Do &c/%{cmd}% help &4for more info."
  621. else:
  622. send "{@lobby} &4Do &c/%{cmd}% help &4for more info."
  623.  
  624.  
  625.  
  626. command /key [<text>] [<text>]:
  627. trigger:
  628. #Detect if world is same
  629. #Detect if key exists
  630. #Give player key is he has permission
  631. #When everything works -> upload it on SkUnity!!!!! :DDD
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement