Zeldaboy111

Skript #165

May 14th, 2019
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.91 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. if file "Files/{@skript_name}/Config.yml" doesn't exist:
  20. create file "Files/{@skript_name}/Config.yml"
  21. load yaml "Files/{@skript_name}/Config.yml" as "Files/{@skript_name}/Config.yml"
  22. set skript-yaml value "Lobby.Location.World" from "Files/{@skript_name}/Config.yml" to "None"
  23. set skript-yaml value "Lobby.Location.Yaw" from "Files/{@skript_name}/Config.yml" to "None"
  24. set skript-yaml value "Lobby.Location.Pitch" from "Files/{@skript_name}/Config.yml" to "None"
  25. set skript-yaml value "Lobby.Location.X" from "Files/{@skript_name}/Config.yml" to "None"
  26. set skript-yaml value "Lobby.Location.Y" from "Files/{@skript_name}/Config.yml" to "None"
  27. set skript-yaml value "Lobby.Location.Z" from "Files/{@skript_name}/Config.yml" to "None"
  28. save yaml "Files/{@skript_name}/Config.yml"
  29.  
  30.  
  31. wait 3 seconds
  32. send "%nl%%nl%{@prefix} &7Succesvol alle &8bestanden &7gemaakt%nl%%nl%" to console
  33.  
  34.  
  35. on disable:
  36. send "%nl%%nl%{@prefix} &4Het Skript &c{@skript_name} &4is uitgezet%nl%%nl%" to console
  37.  
  38.  
  39. on join:
  40. execute console command "/lobby %player%"
  41.  
  42.  
  43. command /lobbyconfig [<text>] [<text>] [<text>] [<text>]:
  44. trigger:
  45. if player has permission "lobby.*":
  46. if arg 1 is "set":
  47. if arg 2 is set:
  48. if arg 3 is "spawn" OR "lobby":
  49. if arg 2 is "lobby":
  50.  
  51. set yaml value "Lobby.Location.World" of file "Files/{@skript_name}/Config.yml" to "%world of player%"
  52. set yaml value "Lobby.Location.Yaw" of file "Files/{@skript_name}/Config.yml" to yaw of player
  53. set yaml value "Lobby.Location.Pitch" of file "Files/{@skript_name}/Config.yml" to pitch of player
  54. set yaml value "Lobby.Location.X" of file "Files/{@skript_name}/Config.yml" to x-coordinate of player
  55. set yaml value "Lobby.Location.Y" of file "Files/{@skript_name}/Config.yml" to y-coordinate of player
  56. set yaml value "Lobby.Location.Z" of file "Files/{@skript_name}/Config.yml" to z-coordinate of player
  57.  
  58. save yaml "Files/{@skript_name}/Config.yml"
  59.  
  60. send "{@prefix} &7Succesvol de &8spawn gezet &7op:"
  61. send "&8World: &7%world of player%"
  62. send "&8Yaw: &7%yaw of player%"
  63. send "&8Pitch: &7%pitch of player%"
  64. send "&8X: &7%x-coordinate of location of player%"
  65. send "&8Y: &7%y-coordinate of location of player%"
  66. send "&8Z: &7%z-coordinate of location of player%"
  67. stop
  68.  
  69.  
  70.  
  71. else if arg 3 is "name":
  72. if arg 4 is set:
  73.  
  74. else:
  75. send "{@prefix} &4Je moet nog een &cnaam &4opgeven."
  76.  
  77. else:
  78. send "{@prefix} &4Je moet &cspawn &4of &cname &4opgeven."
  79.  
  80. else:
  81. send "{@prefix} &4Je moet nog &clobby &4of een &cnaam voor je gamemode &4opgeven en &cwat je wilt doen&4."
  82. send "{@prefix} &4Voor een lijstje met evenementen doe: &c/lobbyconfig eventlist&4."
  83.  
  84.  
  85. else if arg 2 is "delete":
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95. command /lobby [<text>] [<text>]:
  96. trigger:
  97. if executor is console:
  98. if arg 1 is set:
  99. if arg 2 is set:
  100. teleportLobby((arg-1 parsed as a player), "%arg 2%")
  101. send "{@prefix} &7Succesvol de speler &8%arg 1% &7naar de lobby gestuurd." to console
  102.  
  103. else:
  104. teleportLobby((arg-1 parsed as a player), "Lobby")
  105.  
  106.  
  107. else:
  108. if arg 1 is set:
  109. if player has permission "Lobby.*":
  110. if arg 2 is set:
  111. teleportLobby((arg-1 parsed as a player), arg 2)
  112.  
  113. else:
  114. teleportLobby((arg-1 parsed as a player), "Lobby")
  115.  
  116. else:
  117. teleportLobby(player, "Lobby")
  118. else:
  119. teleportLobby(player, "Lobby")
  120.  
  121. #command /colobby [<text>]:
  122.  
  123.  
  124. function teleportLobby(p: player, tVar: string):
  125. if {_tVar} is "Lobby":
  126. set {_world} to yaml value "Lobby.Location.World" of file "Files/{@skript_name}/Config.yml"
  127.  
  128. if {_world} is not "None":
  129. set {_yaw} to yaml value "Lobby.Location.Yaw" of file "Files/{@skript_name}/Config.yml"
  130. set {_pitch} to yaml value "Lobby.Location.Pitch" of file "Files/{@skript_name}/Config.yml"
  131. set {_x} to yaml value "Lobby.Location.X" of file "Files/{@skript_name}/Config.yml"
  132. set {_y} to yaml value "Lobby.Location.Y" of file "Files/{@skript_name}/Config.yml"
  133. set {_z} to yaml value "Lobby.Location.Z" of file "Files/{@skript_name}/Config.yml"
  134.  
  135. set {_loc} to location at ({_x}, {_y}, {_z}) in world "%{_world}%"
  136. set {_loc}'s pitch to {_pitch}
  137. set {_loc}'s yaw to {_yaw}
  138.  
  139. teleport {_p} to {_loc}
  140. stop
  141. else:
  142. send "{@prefix} &4De lobby is &cnog niet gezet&4, doe &c/lobby set &c&llobby &cspawn&4." to {_p}
  143. stop
Advertisement
Add Comment
Please, Sign In to add comment