Zeldaboy111

Skript #166

May 15th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.03 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 &8%arg 2% &7gezet op:"
  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. else:
  70. set yaml value "%arg 2%.Location.World" of file "Files/{@skript_name}/LobbyList/%arg 2%.yml" to "%world of player%"
  71. set yaml value "%arg 2%.Location.Yaw" of file "Files/{@skript_name}/LobbyList/%arg 2%.yml" to yaw of player
  72. set yaml value "%arg 2%.Location.Pitch" of file "Files/{@skript_name}/LobbyList/%arg 2%.yml" to pitch of player
  73. set yaml value "%arg 2%.Location.X" of file "Files/{@skript_name}/LobbyList/%arg 2%.yml" to x-coordinate of player
  74. set yaml value "%arg 2%.Location.Y" of file "Files/{@skript_name}/LobbyList/%arg 2%.yml" to y-coordinate of player
  75. set yaml value "%arg 2%.Location.Z" of file "Files/{@skript_name}/LobbyList/%arg 2%.yml" to z-coordinate of player
  76.  
  77. save yaml "Files/{@skript_name}/LobbyList/%arg 2%.yml"
  78.  
  79. send "{@prefix} &7Succesvol &8%arg 2% &7gezet op:"
  80. send "&8World: &7%world of player%"
  81. send "&8Yaw: &7%yaw of player%"
  82. send "&8Pitch: &7%pitch of player%"
  83. send "&8X: &7%x-coordinate of location of player%"
  84. send "&8Y: &7%y-coordinate of location of player%"
  85. send "&8Z: &7%z-coordinate of location of player%"
  86. stop
  87.  
  88. else if arg 3 is "name":
  89. if arg 4 is set:
  90. if arg 2 is "lobby" OR "spawn":
  91. send "{@prefix} &4Je kan de naam van de &c%arg 2% &4niet aanpassen."
  92. stop
  93.  
  94. else:
  95.  
  96. if file "Files/{@skript_name}/LobbyList/%arg 4%.yml" exists:
  97. send "{@prefix} &4De naam &c%arg 4% &4is al in gebruik."
  98. stop
  99.  
  100. send "{@prefix} &7Bestand &8%arg 2% &7van naam veranderen naar &8%arg 4%&7..."
  101. set {_world} to yaml value "%arg 2%.Location.World" of file "Files/{@skript_name}/LobbyList/%arg 2%.yml"
  102. set {_yaw} to yaml value "%arg 2%.Location.Yaw" of file "Files/{@skript_name}/LobbyList/%arg 2%.yml"
  103. set {_pitch} to yaml value "%arg 2%.Location.Pitch" of file "Files/{@skript_name}/LobbyList/%arg 2%.yml"
  104. set {_x} to yaml value "%arg 2%.Location.X" of file "Files/{@skript_name}/LobbyList/%arg 2%.yml"
  105. set {_y} to yaml value "%arg 2%.Location.Y" of file "Files/{@skript_name}/LobbyList/%arg 2%.yml"
  106. set {_z} to yaml value "%arg 2%.Location.Z" of file "Files/{@skript_name}/LobbyList/%arg 2%.yml"
  107.  
  108. delete file "Files/{@skript_name}/LobbyList/%arg 2%.yml"
  109.  
  110. wait 1 second
  111.  
  112. create file "Files/{@skript_name}/LobbyList/%arg 4%.yml"
  113.  
  114. set yaml value "%arg 4%.Location.World" of file "Files/{@skript_name}/LobbyList/%arg 4%.yml" to {_world}
  115. set yaml value "%arg 4%.Location.Yaw" of file "Files/{@skript_name}/LobbyList/%arg 4%.yml" to {_yaw}
  116. set yaml value "%arg 4%.Location.Pitch" of file "Files/{@skript_name}/LobbyList/%arg 4%.yml" to {_pitch}
  117. set yaml value "%arg 4%.Location.X" of file "Files/{@skript_name}/LobbyList/%arg 4%.yml" to {_x}
  118. set yaml value "%arg 4%.Location.Y" of file "Files/{@skript_name}/LobbyList/%arg 4%.yml" to {_y}
  119. set yaml value "%arg 4%.Location.Z" of file "Files/{@skript_name}/LobbyList/%arg 4%.yml" to {_z}
  120.  
  121. wait 1 second
  122.  
  123. send "{@prefix} &7Bestand &8%arg 2% &7is succesvol van naam gewijzigd naar &8%arg 4%&7."
  124. stop
  125.  
  126.  
  127.  
  128. else:
  129. send "{@prefix} &4Je moet nog een &cnaam &4opgeven."
  130.  
  131. else:
  132. send "{@prefix} &4Je moet &cspawn &4of &cname &4opgeven."
  133.  
  134. else:
  135. send "{@prefix} &4Je moet nog &clobby &4of een &cnaam voor je gamemode &4opgeven en &cwat je wilt doen&4."
  136. send "{@prefix} &4Voor een lijstje met evenementen doe: &c/lobbyconfig eventlist&4."
  137.  
  138.  
  139. else if arg 2 is "delete":
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149. command /lobby [<text>] [<text>]:
  150. trigger:
  151. if executor is console:
  152. if arg 1 is set:
  153. if arg 2 is set:
  154. teleportLobby((arg-1 parsed as a player), "%arg 2%")
  155. send "{@prefix} &7Succesvol de speler &8%arg 1% &7naar de lobby gestuurd." to console
  156.  
  157. else:
  158. teleportLobby((arg-1 parsed as a player), "Lobby")
  159.  
  160.  
  161. else:
  162. if arg 1 is set:
  163. if player has permission "Lobby.*":
  164. if arg 2 is set:
  165. teleportLobby((arg-1 parsed as a player), arg 2)
  166.  
  167. else:
  168. teleportLobby((arg-1 parsed as a player), "Lobby")
  169.  
  170. else:
  171. teleportLobby(player, "Lobby")
  172. else:
  173. teleportLobby(player, "Lobby")
  174.  
  175. #command /colobby [<text>]:
  176.  
  177.  
  178. function teleportLobby(p: player, tVar: string):
  179. if {_tVar} is "Lobby":
  180. set {_world} to yaml value "Lobby.Location.World" of file "Files/{@skript_name}/Config.yml"
  181.  
  182. if {_world} is not "None":
  183. set {_yaw} to yaml value "Lobby.Location.Yaw" of file "Files/{@skript_name}/Config.yml"
  184. set {_pitch} to yaml value "Lobby.Location.Pitch" of file "Files/{@skript_name}/Config.yml"
  185. set {_x} to yaml value "Lobby.Location.X" of file "Files/{@skript_name}/Config.yml"
  186. set {_y} to yaml value "Lobby.Location.Y" of file "Files/{@skript_name}/Config.yml"
  187. set {_z} to yaml value "Lobby.Location.Z" of file "Files/{@skript_name}/Config.yml"
  188.  
  189. set {_loc} to location at ({_x}, {_y}, {_z}) in world "%{_world}%"
  190. set {_loc}'s pitch to {_pitch}
  191. set {_loc}'s yaw to {_yaw}
  192.  
  193. teleport {_p} to {_loc}
  194. stop
  195. else:
  196. send "{@prefix} &4De lobby is &cnog niet gezet&4, doe &c/lobby set &c&llobby &cspawn&4." to {_p}
  197. stop
Advertisement
Add Comment
Please, Sign In to add comment