MisterBasic

ModMenu.sk

Feb 18th, 2018
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.90 KB | None | 0 0
  1. options:
  2. version: 1.0
  3. on load:
  4. if file "plugins/ModMenu/modlist.yml" doesn't exist:
  5. create file "plugins/ModMenu/modlist.yml"
  6. set yml value "modlist.1.name" of file "plugins/ModMenu/modlist.yml" to "SkriptEssentials"
  7. set yml value "modlist.1.desc" of file "plugins/ModMenu/modlist.yml" to "All Essential commands for Skript!"
  8. set yml value "modlist.1.link" of file "plugins/ModMenu/modlist.yml" to "https://pastebin.com/raw/M31YWSkV"
  9. set yml value "modlist.1.author" of file "plugins/ModMenu/modlist.yml" to "MisterBasic"
  10.  
  11. set yml value "modlist.2.name" of file "plugins/ModMenu/modlist.yml" to "ConsoleAPI"
  12. set yml value "modlist.2.desc" of file "plugins/ModMenu/modlist.yml" to "Improve your console!"
  13. set yml value "modlist.2.link" of file "plugins/ModMenu/modlist.yml" to "https://pastebin.com/raw/Tc2c4x5F"
  14. set yml value "modlist.2.author" of file "plugins/ModMenu/modlist.yml" to "MisterBasic"
  15.  
  16. set yml value "modlist.3.name" of file "plugins/ModMenu/modlist.yml" to "JsonAPI"
  17. set yml value "modlist.3.desc" of file "plugins/ModMenu/modlist.yml" to "Use special API for your scripts!"
  18. set yml value "modlist.3.link" of file "plugins/ModMenu/modlist.yml" to "https://pastebin.com/raw/SgDUM47H"
  19. set yml value "modlist.3.author" of file "plugins/ModMenu/modlist.yml" to "Rezz"
  20.  
  21. set yml value "modlist.4.name" of file "plugins/ModMenu/modlist.yml" to "TitleAPI"
  22. set yml value "modlist.4.desc" of file "plugins/ModMenu/modlist.yml" to "Use special API for your scripts!"
  23. set yml value "modlist.4.link" of file "plugins/ModMenu/modlist.yml" to "https://pastebin.com/raw/d3gyZMi9"
  24. set yml value "modlist.4.author" of file "plugins/ModMenu/modlist.yml" to "Bryce/vexio"
  25.  
  26. command /mod [<text>]:
  27. permission: modmenu.mod
  28. permission message: &cYou do not have permission!
  29. trigger:
  30. if arg 1 is "options":
  31. open virtual chest inventory with size 5 named "Mod Options" to player
  32. set {menu.%player%} to true
  33. else:
  34. open virtual chest inventory with size 5 named "&6Mods" to player
  35. set {menu.%player%} to true
  36. set {_loop} to 0
  37. loop 9 times:
  38. format gui slot {_loop} of player with black stained glass named "&0" to do nothing
  39. add 1 to {_loop}
  40. if arg 1 is not set:
  41. set {_mod} to 0
  42. set {_loop} to yml value "info.mods" of file "plugins/ModMenu/modlist.yml"
  43. loop {_loop} times:
  44. if yml value "modlist.%{_mod}%" of file "plugins/ModMenu/modlist.yml" is not set:
  45. format gui slot {_mod}+9 of player with red stained glass named "&4Error" with lore "&7No file found."
  46. add 1 to {_mod}
  47. else:
  48. set {_mod.name} to yml value "modlist.%{_mod}%.name" of file "plugins/ModMenu/modlist.yml"
  49. set {_mod.desc} to yml value "modlist.%{_mod}%.desc" of file "plugins/ModMenu/modlist.yml"
  50. set {_mod.link} to yml value "modlist.%{_mod}%.link" of file "plugins/ModMenu/modlist.yml"
  51. set {_mod.author} to yml value "modlist.%{_mod}%.author" of file "plugins/ModMenu/modlist.yml"
  52. format gui slot 9+{_mod} of player with green stained glass named "&4&n&l%{_mod.name}%" with lore "&8Description:||&7%{_mod.desc}%||&8Author:||&7 %{_mod.author}%" to close then run function installMod("%{_mod.link}%", "%{_mod.name}%")
  53. add 1 to {_mod}
  54. set {_loop} to {_mod}+9
  55. loop 34-{_mod} times:
  56. format gui slot {_loop} of player with red stained glass named "&4Error" with lore "&7No file found." to do nothing
  57. add 1 to {_loop}
  58. set {_loop} to 36
  59. loop 9 times:
  60. format gui slot {_loop} of player with black stained glass named "&0" to do nothing
  61. add 1 to {_loop}
  62. if arg 1 is "options":
  63. format gui slot 22 of player with red stained glass named "&4Reload" with lore "&7Reload everything!" to close then run console command "/modcmd %player% reload"
  64. format gui slot 21 of player with orange stained glass named "&6Update" with lore "&7Update this script!" to close then run console command "/modcmd %player% update"
  65. set {menu.%player%} to true
  66. on inventory close:
  67. set {menu.%player%} to false
  68. on inventory click:
  69. if {menu.%player%} is true:
  70. cancel event
  71. command /modcmd [<offlineplayer>] [<text>] [<text>]:
  72. executable by: console
  73. trigger:
  74. if arg 2 is "reload":
  75. if arg 3 is not set:
  76. wait a tick
  77. make console execute "/skript reload %script name%.sk"
  78. send "&1Reloaded!" to arg 1
  79. else:
  80. make console execute "/skript reload Mods\%arg 3%.sk"
  81. if arg 2 is "update":
  82. send "&1Updating to the lastest version!" to the player
  83. delete file "plugisn/Skript/scripts/ModMenu.sk"
  84. wait a tick
  85. download file from "https://pastebin.com/raw/32D1EanU" to file "plugins/Skript/scripts/ModMenu.sk"
  86. make console execute "/skript reload %script name%.sk"
  87. function installMod(link: text, name: text):
  88. send "&1Installing Server Mod %{_name}% from %{_link}%" to console
  89. download file from "%{_link}%" to file "plugins/Skript/scripts/Mods/%{_name}%.sk"
  90. make console execute "/modcmd null reload %{_name}%"
  91. # End
Advertisement
Add Comment
Please, Sign In to add comment