Zeldaboy111

Skript #171 - Lobby

May 22nd, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.49 KB | None | 0 0
  1. options:
  2. skript_name: Lobby
  3. version: 1.0
  4. prefix: &f[&3Lobby&f] &8>>
  5.  
  6.  
  7. on enable:
  8. send "%nl%%nl%{@prefix} &7Het Skript &8{@skript_name} &7is aangezet" to console
  9. send "{@prefix} &8Bestanden &7aan het maken...%nl%%nl%" to console
  10.  
  11. #Direction
  12. if dir "Files/{@skript_name}" doesn't exist:
  13. create dir "Files/{@skript_name}"
  14.  
  15. if dir "Files/{@skript_name}/LobbyList" doesn't exist:
  16. create dir "Files/{@skript_name}/LobbyList"
  17.  
  18. #Bestanden
  19. setup("config")
  20.  
  21.  
  22. wait 3 seconds
  23. send "%nl%%nl%{@prefix} &7Succesvol alle &8bestanden &7gemaakt%nl%%nl%" to console
  24.  
  25.  
  26. on disable:
  27. send "%nl%%nl%{@prefix} &4Het Skript &c{@skript_name} &4is uitgezet%nl%%nl%" to console
  28.  
  29.  
  30. on join:
  31. execute console command "/lobby %player%"
  32.  
  33.  
  34. command /lobbyconfig [<text>] [<text>] [<text>] [<text>]:
  35. trigger:
  36. if player has permission "lobby.*":
  37. if arg 1 is "set":
  38. if arg 2 is set:
  39. if arg 3 is "spawn" OR "lobby":
  40. if arg 2 is "lobby":
  41.  
  42. #setValue("Lobby", "set", player)
  43.  
  44. send "{@prefix} &7Succesvol de &8%arg 2% &7gezet op:"
  45. send "&8World: &7%world of player%"
  46. send "&8Yaw: &7%yaw of player%"
  47. send "&8Pitch: &7%pitch of player%"
  48. send "&8X: &7%x-coordinate of location of player%"
  49. send "&8Y: &7%y-coordinate of location of player%"
  50. send "&8Z: &7%z-coordinate of location of player%"
  51. stop
  52.  
  53. else:
  54. set yaml value "%arg 2%.Location.World" of file "Files/{@skript_name}/LobbyList/%arg 2%.yml" to "%world of player%"
  55. set yaml value "%arg 2%.Location.Yaw" of file "Files/{@skript_name}/LobbyList/%arg 2%.yml" to yaw of player
  56. set yaml value "%arg 2%.Location.Pitch" of file "Files/{@skript_name}/LobbyList/%arg 2%.yml" to pitch of player
  57. set yaml value "%arg 2%.Location.X" of file "Files/{@skript_name}/LobbyList/%arg 2%.yml" to x-coordinate of player
  58. set yaml value "%arg 2%.Location.Y" of file "Files/{@skript_name}/LobbyList/%arg 2%.yml" to y-coordinate of player
  59. set yaml value "%arg 2%.Location.Z" of file "Files/{@skript_name}/LobbyList/%arg 2%.yml" to z-coordinate of player
  60.  
  61. save yaml "Files/{@skript_name}/LobbyList/%arg 2%.yml"
  62.  
  63. send "{@prefix} &7Succesvol &8%arg 2% &7gezet op:"
  64. send "&8World: &7%world of player%"
  65. send "&8Yaw: &7%yaw of player%"
  66. send "&8Pitch: &7%pitch of player%"
  67. send "&8X: &7%x-coordinate of location of player%"
  68. send "&8Y: &7%y-coordinate of location of player%"
  69. send "&8Z: &7%z-coordinate of location of player%"
  70. stop
  71.  
  72. else if arg 3 is "name":
  73. if arg 4 is set:
  74. if arg 2 is "lobby" OR "spawn":
  75. send "{@prefix} &4Je kan de naam van de &c%arg 2% &4niet aanpassen."
  76. stop
  77.  
  78. else:
  79.  
  80. if file "Files/{@skript_name}/LobbyList/%arg 4%.yml" exists:
  81. send "{@prefix} &4De naam &c%arg 4% &4is al in gebruik."
  82. stop
  83.  
  84. send "{@prefix} &7Bestand &8%arg 2% &7van naam veranderen naar &8%arg 4%&7..."
  85.  
  86. renameLobby("%arg 2%", "%arg 4%")
  87.  
  88. wait 1 second
  89.  
  90. send "{@prefix} &7Bestand &8%arg 2% &7is succesvol van naam gewijzigd naar &8%arg 4%&7."
  91. stop
  92.  
  93.  
  94.  
  95. else:
  96. send "{@prefix} &4Je moet nog een &cnaam &4opgeven."
  97.  
  98. else:
  99. send "{@prefix} &4Je moet &cspawn &4of &cname &4opgeven."
  100.  
  101. else:
  102. send "{@prefix} &4Je moet nog &clobby &4of een &cnaam voor je gamemode &4opgeven en &cwat je wilt doen&4."
  103. send "{@prefix} &4Voor een lijstje met evenementen doe: &c/lobbyconfig eventlist&4."
  104.  
  105.  
  106. else if arg 1 is "delete":
  107. if arg 2 is set:
  108. if arg 2 is "lobby" OR "spawn":
  109. setup("config")
  110.  
  111. send "{@prefix} &7Succesvol de &8%arg 2% &7verwijderd."
  112. stop
  113.  
  114.  
  115. else:
  116. if file "Files/{@skript_name}/LobbyList/%arg 2%.yml" exists:
  117.  
  118. delete file "Files/{@skript_name}/LobbyList/%arg 2%.yml"
  119. send "{@prefix} &7Succesvol het bestand &8%arg 2%.yml &7verwijderd."
  120. stop
  121.  
  122. else:
  123. send "{@prefix} &4De lobby &c%arg 2% &4bestaat niet."
  124. stop
  125.  
  126. else:
  127. send "{@prefix} &4Je moet nog een &clobby naam &4opgeven."
  128. stop
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137. command /lobby [<text>] [<text>]:
  138. trigger:
  139. if executor is console:
  140. if arg 1 is set:
  141. if arg 2 is set:
  142. teleportLobby((arg-1 parsed as a player), "%arg 2%")
  143. send "{@prefix} &7Succesvol de speler &8%arg 1% &7naar de lobby gestuurd." to console
  144.  
  145. else:
  146. teleportLobby((arg-1 parsed as a player), "Lobby")
  147.  
  148.  
  149. else:
  150. if arg 1 is set:
  151. if player has permission "Lobby.*":
  152. if arg 2 is set:
  153. teleportLobby((arg-1 parsed as a player), arg 2)
  154.  
  155. else:
  156. teleportLobby((arg-1 parsed as a player), "Lobby")
  157.  
  158. else:
  159. teleportLobby(player, "Lobby")
  160. else:
  161. teleportLobby(player, "Lobby")
  162.  
  163.  
  164. command /lobbycompass [<text>] [<text>] [<text>] [<text>] [<text>]:
  165. aliases: /lc
  166. trigger:
  167. if player has permission "Lobby.*":
  168. if arg 1 is "config":
  169. if arg 2 is "create":
  170. if arg 3 is set:
  171. if file "Files/{@skript_name}/LobbyList/%arg 3%.yml" exists:
  172.  
  173. if arg 4 is set:
  174. if arg 4 is an item:
  175.  
  176. stop
  177. else:
  178. send "{@prefix} &4Het item &c%arg 4% &4is geen item."
  179. stop
  180. else:
  181. send "{@prefix} &4Je moet nog een &citem &4opgeven."
  182. stop
  183. else:
  184. send "{@prefix} &4Het bestand &c%arg 3%.yml &4bestaat niet."
  185. stop
  186. else:
  187. send "{@prefix} &4Je moet nog een &clobbynaam &4en &citem &4opgeven."
  188. stop
  189.  
  190.  
  191.  
  192. if arg 2 is "edit":
  193. if arg 3 is set:
  194. if file "Files/{@skript_name}/LobbyList/%arg 3%.yml" exists:
  195. if arg 4 is "setname":
  196. if arg 5 is set:
  197. set yaml value "%arg 3%.LobbyCompass.name" of file "Files/{@skript_name}/LobbyList/%arg 3%.yml" to "%arg 5%"
  198. save yaml "Files/{@skript_name}/LobbyList/%arg 3%.yml"
  199.  
  200. send "{@prefix} &7Succesvol de naam van &8%arg 3% &7veranderd naar: &8%arg 5%"
  201. stop
  202.  
  203. else:
  204. send "{@prefix} &4Je moet nog een &cnaam voor het item &4opgeven."
  205. stop
  206. if arg 4 is "deletename":
  207.  
  208.  
  209. if arg 4 is "enable":
  210. #EnableOnNameSwitch
  211. #EnableOnLoreSwitch
  212. #EnableOnItemSwitch
  213.  
  214. if arg 4 is "disable":
  215.  
  216. if arg 4 is "setitem":
  217.  
  218.  
  219.  
  220. if arg 4 is "setlore":
  221. if arg 5 is set:
  222.  
  223. if arg 4 is "deletelore":
  224. if arg 5 is set:
  225.  
  226. else:
  227. send "{@prefix} &4Het bestand &c%arg 3%.yml &4bestaat niet."
  228. stop
  229.  
  230.  
  231.  
  232. function teleportLobby(p: player, tVar: string):
  233. if {_tVar} is "Lobby":
  234. set {_world} to yaml value "Lobby.Location.World" of file "Files/{@skript_name}/Config.yml"
  235.  
  236. if {_world} is not "None":
  237. set {_yaw} to yaml value "Lobby.Location.Yaw" of file "Files/{@skript_name}/Config.yml"
  238. set {_pitch} to yaml value "Lobby.Location.Pitch" of file "Files/{@skript_name}/Config.yml"
  239. set {_x} to yaml value "Lobby.Location.X" of file "Files/{@skript_name}/Config.yml"
  240. set {_y} to yaml value "Lobby.Location.Y" of file "Files/{@skript_name}/Config.yml"
  241. set {_z} to yaml value "Lobby.Location.Z" of file "Files/{@skript_name}/Config.yml"
  242.  
  243. set {_loc} to location at ({_x}, {_y}, {_z}) in world "%{_world}%"
  244. set {_loc}'s pitch to {_pitch}
  245. set {_loc}'s yaw to {_yaw}
  246.  
  247. teleport {_p} to {_loc}
  248. stop
  249. else:
  250. send "{@prefix} &4De lobby is &cnog niet gezet&4, doe &c/lobby set &c&llobby &cspawn&4." to {_p}
  251. stop
Advertisement
Add Comment
Please, Sign In to add comment