Advertisement
fleft17

Untitled

Sep 14th, 2014
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.56 KB | None | 0 0
  1. options:
  2.  
  3. P: &8[&7Pregen&8]
  4. CC: &a
  5. HC: &6
  6. Pregen.TP.Delay: 1 ticks
  7. Correct.Usage: /pregen <radius> <world>
  8. Broadcast.Messages: true
  9. WB.Fill.Speed: 100
  10. Coords.Spam.Chat: true
  11.  
  12. command /pregen [<integer>] [<world>]:
  13. permission: skript.op
  14. trigger:
  15. if {Pregen::Running} is true:
  16. if arg-1 is not set:
  17. delete {Pregen::Running}
  18. stop trigger
  19. else if arg-1 is set:
  20. message "{@P}{@CC} {@Correct.Usage}"
  21. if arg-1 is less than 16:
  22. message "{@P}{@CC} You cannot pregen with a radius less than 16!"
  23. stop trigger
  24. if arg-2 is not set:
  25. message "{@P}{@CC} {@Correct.Usage}"
  26. stop trigger
  27. loop 3 times:
  28. command "/pregen-sound note.harp"
  29. wait 4 ticks
  30. set {Pregen::Location} to (location at (0, 255, 0) of the world (arg-2))
  31. while (block at {Pregen::Location}) is air:
  32. set {Pregen::Location} to location 1 below {Pregen::Location}
  33. if y-coordinate of {Pregen::Location} is less than 5:
  34. message "{@P}{@CC} Error: Could not teleport {@HC}%command sender%{@CC} to 0,0."
  35. wait 1 tick
  36. teleport command sender to (location 1 above {Pregen::Location})
  37. command sender command "/wb set %arg-1%"
  38. broadcast "{@P}{@CC}&r&k----------------------------------"
  39. broadcast "{@P}{@HC} %command sender%{@CC}: {@HC}%arg-1%{@CC} in {@HC}%arg-2%!"
  40. broadcast "{@P}{@CC} Beginning pregen! There may be lag! Do not log out!"
  41. broadcast "{@P}{@HC} Pregen Skript by Fleft"
  42. broadcast "{@P}{@CC}&r&k----------------------------------"
  43. set command sender's gamemode to creative
  44. set {Pregen::Running} to true
  45. set {Pregen::Radius} to arg-1
  46. set {Pregen::World} to arg-2
  47. set {Pregen::Loop.1} to 0
  48. set {Pregen::Loop.2} to 0
  49. set {Pregen::Count} to 0
  50. set {Pregen::Time} to 0
  51. set {Pregen::Notify} to now
  52. wait 1 second
  53. set {_count} to 3
  54. loop 3 times:
  55. broadcast "{@P}{@CC} Starting:{@HC} %{_count}%..."
  56. command "/pregen-sound note.harp"
  57. subtract 1 from {_count}
  58. wait 1 second
  59. loop ({Pregen::Radius}*2) times:
  60. add 1 to {Pregen::Loop.1}
  61. if {Pregen::Loop.1} is equal to 16:
  62. set {Pregen::Time} to rounded down ((loop-number-1)/{Pregen::Radius})*50
  63. if {@Broadcast.Messages} is true:
  64. if {Pregen::Notify} was more than 5 seconds ago:
  65. broadcast "{@P}{@CC} Progress: {@HC}%{Pregen::Time}%%%"
  66. set {Pregen::Notfy} to now
  67. command "/pregen-sound note.harp"
  68. set {Pregen::Loop.1} to 0
  69. loop ({Pregen::Radius}*2) times:
  70. {Pregen::Running} is not set:
  71. delete {Pregen::*}
  72. broadcast "{@P}{@HC} Cancelled!"
  73. command "/pregen-sound random.break"
  74. wait 5 ticks
  75. set {Pregen::Location} to (location at (0, 255, 0) of the world (world of command sender))
  76. while (block at {Pregen::Location}) is air:
  77. set {Pregen::Location} to location 1 below {Pregen::Location}
  78. if y-coordinate of {Pregen::Location} is less than 5:
  79. message "{@P}{@CC} Error: Could not teleport {@HC}%command sender%{@CC} to 0,0."
  80. wait 1 tick
  81. teleport command sender to (location 1 above {Pregen::Location})
  82. message "{@P}{@CC} You were TPed to {@HC}0,%y-coordinate of command sender%,0!"
  83. delete {Pregen::Location}
  84. stop trigger
  85. add 1 to {Pregen::Loop.2}
  86. if {Pregen::Loop.2} is equal to 16:
  87. set {Pregen::Loop.2} to 0
  88. set {Pregen::x.coord} to ((loop-number-1)-{Pregen::Radius})
  89. set {Pregen::z.coord} to ((loop-number-2)-{Pregen::Radius})
  90. set {Pregen::Location} to (location at ({Pregen::x.coord}, 200, {Pregen::z.coord}) of the world ({Pregen::World}))
  91. while (block at {Pregen::Location}) is air:
  92. set {Pregen::Location} to location 1 below {Pregen::Location}
  93. if y-coordinate of {Pregen::Location} is less than 5:
  94. if {@Broadcast.Messages} is true:
  95. broadcast "{@P}{@CC} Void: skipping location"
  96. delete {Pregen::Location}
  97. if command sender is not online:
  98. broadcast "{@P}{@CC} Pregenning interrupted. {@HC}%command sender%{@CC} logged out."
  99. delete {Pregen::Running}
  100. teleport command sender to (location 1 above {Pregen::Location})
  101. if {@Coords.Spam.Chat} is true:
  102. message "{@P}{@CC} %{Pregen::Location}%"
  103. add 1 to {Pregen::Time}
  104. wait {@Pregen.TP.Delay}
  105. broadcast "{@P}{@CC} Pregenning finished: ~{@HC}%{Pregen::Time}/16% minutes."
  106. delete {Pregen::*}
  107. set {Pregen::Location} to (location at (0, 255, 0) of the world (world of command sender))
  108. while (block at {Pregen::Location}) is air:
  109. set {Pregen::Location} to location 1 below {Pregen::Location}
  110. if y-coordinate of {Pregen::Location} is less than 5:
  111. broadcast "{@P}{@CC} Error: Could not teleport {@HC}%command sender%{@CC} to 0,0."
  112. delete {Pregen::Location}
  113. wait 1 tick
  114. teleport command sender to (location 1 above {Pregen::Location})
  115. message "{@P}{@CC} You were TPed to {@HC}0,%y-coordinate of command sender%,0!"
  116. command sender command "/wb set %arg-1%"
  117. wait 1 tick
  118. command sender command "/wb fill {@WB.Fill.Speed}"
  119. wait 1 tick
  120. command sender command "/wb fill confirm"
  121. loop 3 times:
  122. command "/pregen-sound note.harp"
  123. wait 3 ticks
  124. broadcast "{@P}{@CC}&r&k----------------------------------"
  125. broadcast "{@P}{@CC} Automatically finishing pregen using"
  126. broadcast "{@P}{@HC} WorldBorder!{@CC} May be small lag!"
  127. broadcast "{@P}{@CC}&r&k----------------------------------"
  128. execute console command "/pregen-sound random.explode"
  129.  
  130.  
  131. command /pregen-sound <text>:
  132. permission: skript.pregen
  133. trigger:
  134. loop all players:
  135. execute console command "/playsound %arg% %loop-player% ~ ~ ~ 1 1 1"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement