Advertisement
fleft17

Untitled

Sep 14th, 2014
273
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[&ePregen&8]
  4. CC: &a
  5. HC: &6
  6. Pregen.TP.Delay: 0.25 ticks
  7. Correct.Usage: /pregen &6<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}{@HC} To cancel, use /pregen"
  21. stop trigger
  22. if arg-2 is not set:
  23. message "{@P}{@CC} {@Correct.Usage}"
  24. stop trigger
  25. loop 3 times:
  26. command "/pregen-sound note.harp"
  27. wait 3 ticks
  28. set {Pregen::Location} to (location at (0, 255, 0) of the world (arg-2))
  29. while (block at {Pregen::Location}) is air:
  30. set {Pregen::Location} to location 1 below {Pregen::Location}
  31. if y-coordinate of {Pregen::Location} is less than 5:
  32. message "{@P}{@CC} Error: Could not teleport {@HC}%command sender%{@CC} to 0,0."
  33. command "/pregen-sound random.break"
  34. stop trigger
  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 {Pregen::Notify} was more than 5 seconds ago:
  64. set {Pregen::Notfy} to now
  65. if {@Broadcast.Messages} is true:
  66. broadcast "{@P}{@CC} Progress: {@HC}%{Pregen::Time}%%%"
  67. command "/pregen-sound note.harp"
  68. else:
  69. message "{@P}{@CC} Progress: {@HC}%{Pregen::Time}%%%"
  70. set {Pregen::Loop.1} to 0
  71. loop ({Pregen::Radius}*2) times:
  72. {Pregen::Running} is not set:
  73. delete {Pregen::*}
  74. broadcast "{@P}{@HC} Cancelled!"
  75. command "/pregen-sound random.break"
  76. wait 5 ticks
  77. set {Pregen::Location} to (location at (0, 255, 0) of the world (world of command sender))
  78. while (block at {Pregen::Location}) is air:
  79. set {Pregen::Location} to location 1 below {Pregen::Location}
  80. if y-coordinate of {Pregen::Location} is less than 5:
  81. message "{@P}{@CC} Error: Could not teleport {@HC}%command sender%{@CC} to 0,0."
  82. wait 1 tick
  83. teleport command sender to (location 1 above {Pregen::Location})
  84. message "{@P}{@CC} You were TPed to {@HC}0,%y-coordinate of command sender%,0!"
  85. delete {Pregen::Location}
  86. stop trigger
  87. add 1 to {Pregen::Loop.2}
  88. if {Pregen::Loop.2} is equal to 16:
  89. set {Pregen::Loop.2} to 0
  90. set {Pregen::x.coord} to ((loop-number-1)-{Pregen::Radius})
  91. set {Pregen::z.coord} to ((loop-number-2)-{Pregen::Radius})
  92. set {Pregen::Location} to (location at ({Pregen::x.coord}, 200, {Pregen::z.coord}) of the world ({Pregen::World}))
  93. while (block at {Pregen::Location}) is air:
  94. set {Pregen::Location} to location 1 below {Pregen::Location}
  95. if y-coordinate of {Pregen::Location} is less than 5:
  96. if {@Broadcast.Messages} is true:
  97. broadcast "{@P}{@CC} Void: skipping location"
  98. delete {Pregen::Location}
  99. if command sender is not online:
  100. broadcast "{@P}{@CC} Pregenning interrupted. {@HC}%command sender%{@CC} logged out."
  101. delete {Pregen::Running}
  102. teleport command sender to (location 1 above {Pregen::Location})
  103. if {@Coords.Spam.Chat} is true:
  104. message "{@P}{@CC} %{Pregen::Location}%"
  105. add 1 to {Pregen::Time}
  106. wait {@Pregen.TP.Delay}
  107. delete {Pregen::*}
  108. set {Pregen::Location} to (location at (0, 255, 0) of the world (world of command sender))
  109. while (block at {Pregen::Location}) is air:
  110. set {Pregen::Location} to location 1 below {Pregen::Location}
  111. if y-coordinate of {Pregen::Location} is less than 5:
  112. broadcast "{@P}{@CC} Error: Could not teleport {@HC}%command sender%{@CC} to 0,0."
  113. delete {Pregen::Location}
  114. wait 1 tick
  115. teleport command sender to (location 1 above {Pregen::Location})
  116. message "{@P}{@CC} You were TPed to {@HC}0,%y-coordinate of command sender%,0!"
  117. command sender command "/wb set %arg-1%"
  118. wait 1 tick
  119. command sender command "/wb fill {@WB.Fill.Speed}"
  120. wait 1 tick
  121. command sender command "/wb fill confirm"
  122. broadcast "{@P}{@CC}&r&k----------------------------------"
  123. broadcast "{@P}{@CC} Automatically finishing pregen using"
  124. broadcast "{@P}{@HC} WorldBorder!{@CC} May be small lag!"
  125. broadcast "{@P}{@CC}&r&k----------------------------------"
  126. loop 7 times:
  127. command "/pregen-sound fireworks.launch"
  128. command "/pregen-sound fireworks.twinkle"
  129. wait 3 ticks
  130. command "/pregen-sound random.levelup"
  131.  
  132.  
  133. command /pregen-sound <text>:
  134. permission: skript.pregen
  135. trigger:
  136. loop all players:
  137. execute console command "/playsound %arg% %loop-player% ~ ~ ~ 1 1 1"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement