Zeldaboy111

Skript #170 - Lobby

May 21st, 2019
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.46 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. set {_world} to yaml value "%arg 2%.Location.World" of file "Files/{@skript_name}/LobbyList/%arg 2%.yml"
  86. set {_yaw} to yaml value "%arg 2%.Location.Yaw" of file "Files/{@skript_name}/LobbyList/%arg 2%.yml"
  87. set {_pitch} to yaml value "%arg 2%.Location.Pitch" of file "Files/{@skript_name}/LobbyList/%arg 2%.yml"
  88. set {_x} to yaml value "%arg 2%.Location.X" of file "Files/{@skript_name}/LobbyList/%arg 2%.yml"
  89. set {_y} to yaml value "%arg 2%.Location.Y" of file "Files/{@skript_name}/LobbyList/%arg 2%.yml"
  90. set {_z} to yaml value "%arg 2%.Location.Z" of file "Files/{@skript_name}/LobbyList/%arg 2%.yml"
  91.  
  92. delete file "Files/{@skript_name}/LobbyList/%arg 2%.yml"
  93.  
  94. wait 1 second
  95.  
  96. create file "Files/{@skript_name}/LobbyList/%arg 4%.yml"
  97.  
  98. set yaml value "%arg 4%.Location.World" of file "Files/{@skript_name}/LobbyList/%arg 4%.yml" to {_world}
  99. set yaml value "%arg 4%.Location.Yaw" of file "Files/{@skript_name}/LobbyList/%arg 4%.yml" to {_yaw}
  100. set yaml value "%arg 4%.Location.Pitch" of file "Files/{@skript_name}/LobbyList/%arg 4%.yml" to {_pitch}
  101. set yaml value "%arg 4%.Location.X" of file "Files/{@skript_name}/LobbyList/%arg 4%.yml" to {_x}
  102. set yaml value "%arg 4%.Location.Y" of file "Files/{@skript_name}/LobbyList/%arg 4%.yml" to {_y}
  103. set yaml value "%arg 4%.Location.Z" of file "Files/{@skript_name}/LobbyList/%arg 4%.yml" to {_z}
  104.  
  105. wait 1 second
  106.  
  107. send "{@prefix} &7Bestand &8%arg 2% &7is succesvol van naam gewijzigd naar &8%arg 4%&7."
  108. stop
  109.  
  110.  
  111.  
  112. else:
  113. send "{@prefix} &4Je moet nog een &cnaam &4opgeven."
  114.  
  115. else:
  116. send "{@prefix} &4Je moet &cspawn &4of &cname &4opgeven."
  117.  
  118. else:
  119. send "{@prefix} &4Je moet nog &clobby &4of een &cnaam voor je gamemode &4opgeven en &cwat je wilt doen&4."
  120. send "{@prefix} &4Voor een lijstje met evenementen doe: &c/lobbyconfig eventlist&4."
  121.  
  122.  
  123. else if arg 1 is "delete":
  124. if arg 2 is set:
  125. if arg 2 is "lobby" OR "spawn":
  126. set yaml value "Lobby.Location.World" of file "Files/{@skript_name}/Config.yml" to "None"
  127. set yaml value "Lobby.Location.Yaw" of file "Files/{@skript_name}/Config.yml" to "None"
  128. set yaml value "Lobby.Location.Pitch" of file "Files/{@skript_name}/Config.yml" to "None"
  129. set yaml value "Lobby.Location.X" of file "Files/{@skript_name}/Config.yml" to "None"
  130. set yaml value "Lobby.Location.Y" of file "Files/{@skript_name}/Config.yml" to "None"
  131. set yaml value "Lobby.Location.Z" of file "Files/{@skript_name}/Config.yml" to "None"
  132.  
  133. save yaml "Files/{@skript_name}/Config.yml"
  134.  
  135. send "{@prefix} &7Succesvol de &8%arg 2% &7verwijderd."
  136. stop
  137.  
  138.  
  139. else:
  140. if file "Files/{@skript_name}/LobbyList/%arg 2%.yml" exists:
  141.  
  142. delete file "Files/{@skript_name}/LobbyList/%arg 2%.yml"
  143. send "{@prefix} &7Succesvol het bestand &8%arg 2%.yml &7verwijderd."
  144. stop
  145.  
  146. else:
  147. send "{@prefix} &4De lobby &c%arg 2% &4bestaat niet."
  148. stop
  149.  
  150. else:
  151. send "{@prefix} &4Je moet nog een &clobby naam &4opgeven."
  152. stop
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161. command /lobby [<text>] [<text>]:
  162. trigger:
  163. if executor is console:
  164. if arg 1 is set:
  165. if arg 2 is set:
  166. teleportLobby((arg-1 parsed as a player), "%arg 2%")
  167. send "{@prefix} &7Succesvol de speler &8%arg 1% &7naar de lobby gestuurd." to console
  168.  
  169. else:
  170. teleportLobby((arg-1 parsed as a player), "Lobby")
  171.  
  172.  
  173. else:
  174. if arg 1 is set:
  175. if player has permission "Lobby.*":
  176. if arg 2 is set:
  177. teleportLobby((arg-1 parsed as a player), arg 2)
  178.  
  179. else:
  180. teleportLobby((arg-1 parsed as a player), "Lobby")
  181.  
  182. else:
  183. teleportLobby(player, "Lobby")
  184. else:
  185. teleportLobby(player, "Lobby")
  186.  
  187.  
  188. command /lobbycompass [<text>] [<text>] [<text>] [<text>] [<text>]:
  189. aliases: /lc
  190. trigger:
  191. if player has permission "Lobby.*":
  192. if arg 1 is "config":
  193. if arg 2 is "create":
  194. if arg 3 is set:
  195. if file "Files/{@skript_name}/LobbyList/%arg 3%.yml" exists:
  196.  
  197. if arg 4 is set:
  198. if arg 4 is an item:
  199.  
  200. stop
  201. else:
  202. send "{@prefix} &4Het item &c%arg 4% &4is geen item."
  203. stop
  204. else:
  205. send "{@prefix} &4Je moet nog een &citem &4opgeven."
  206. stop
  207. else:
  208. send "{@prefix} &4Het bestand &c%arg 3%.yml &4bestaat niet."
  209. stop
  210. else:
  211. send "{@prefix} &4Je moet nog een &clobbynaam &4en &citem &4opgeven."
  212. stop
  213.  
  214.  
  215.  
  216. if arg 2 is "edit":
  217. if arg 3 is set:
  218. if file "Files/{@skript_name}/LobbyList/%arg 3%.yml" exists:
  219. if arg 4 is "setname":
  220. if arg 5 is set:
  221. set yaml value "%arg 3%.LobbyCompass.name" of file "Files/{@skript_name}/LobbyList/%arg 3%.yml" to "%arg 5%"
  222. save yaml "Files/{@skript_name}/LobbyList/%arg 3%.yml"
  223.  
  224. send "{@prefix} &7Succesvol de naam van &8%arg 3% &7veranderd naar: &8%arg 5%"
  225. stop
  226.  
  227. else:
  228. send "{@prefix} &4Je moet nog een &cnaam voor het item &4opgeven."
  229. stop
  230. if arg 4 is "deletename":
  231.  
  232.  
  233. if arg 4 is "enable":
  234. #EnableOnNameSwitch
  235. #EnableOnLoreSwitch
  236. #EnableOnItemSwitch
  237.  
  238. if arg 4 is "disable":
  239.  
  240. if arg 4 is "setitem":
  241.  
  242.  
  243.  
  244. if arg 4 is "setlore":
  245. if arg 5 is set:
  246.  
  247. if arg 4 is "deletelore":
  248. if arg 5 is set:
  249.  
  250. else:
  251. send "{@prefix} &4Het bestand &c%arg 3%.yml &4bestaat niet."
  252. stop
  253.  
  254.  
  255.  
  256. function teleportLobby(p: player, tVar: string):
  257. if {_tVar} is "Lobby":
  258. set {_world} to yaml value "Lobby.Location.World" of file "Files/{@skript_name}/Config.yml"
  259.  
  260. if {_world} is not "None":
  261. set {_yaw} to yaml value "Lobby.Location.Yaw" of file "Files/{@skript_name}/Config.yml"
  262. set {_pitch} to yaml value "Lobby.Location.Pitch" of file "Files/{@skript_name}/Config.yml"
  263. set {_x} to yaml value "Lobby.Location.X" of file "Files/{@skript_name}/Config.yml"
  264. set {_y} to yaml value "Lobby.Location.Y" of file "Files/{@skript_name}/Config.yml"
  265. set {_z} to yaml value "Lobby.Location.Z" of file "Files/{@skript_name}/Config.yml"
  266.  
  267. set {_loc} to location at ({_x}, {_y}, {_z}) in world "%{_world}%"
  268. set {_loc}'s pitch to {_pitch}
  269. set {_loc}'s yaw to {_yaw}
  270.  
  271. teleport {_p} to {_loc}
  272. stop
  273. else:
  274. send "{@prefix} &4De lobby is &cnog niet gezet&4, doe &c/lobby set &c&llobby &cspawn&4." to {_p}
  275. stop
Advertisement
Add Comment
Please, Sign In to add comment