Advertisement
fleft17

Untitled

Sep 14th, 2014
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.04 KB | None | 0 0
  1. options:
  2.  
  3. P: &7[&ePregen&7]
  4. CC: &r
  5. HC: &b
  6. Pregen.TP.Delay: 1 ticks
  7. Correct.Usage: /pregen <radius> <world>
  8. Broadcast.Messages: true
  9.  
  10. command /pregen [<integer>] [<world>]:
  11. permission: skript.op
  12. trigger:
  13. if {Pregen::Running} is true:
  14. if arg-1 is not set:
  15. broadcast "{@P}{@CC} Pregenning cancelled."
  16. delete {Pregen::Running}
  17. stop trigger
  18. else:
  19. message "{@P}{@CC} {@Correct.Usage}"
  20. if arg-1 is less than 16:
  21. message "{@P}{@CC} You cannot pregen with a radius less than 16!"
  22. stop trigger
  23. if arg-2 is not set:
  24. message "{@P}{@CC} {@Correct.Usage}"
  25. stop trigger
  26. broadcast "{@P}{@HC} %command sender%{@CC}: {@HC}%arg-1%{@CC} in {@HC}%arg-2%!"
  27. set command sender's gamemode to creative
  28. set {Pregen::Running} to true
  29. set {Pregen::Radius} to arg-1
  30. set {Pregen::Radius} to arg-1
  31. set {Pregen::World} to arg-2
  32. set {Pregen::Loop.1} to 0
  33. set {Pregen::Loop.2} to 0
  34. set {Pregen::Count} to 0
  35. set {Pregen::Time} to 0
  36. loop ({Pregen::Radius}*2) times:
  37. add 1 to {Pregen::Loop.1}
  38. if {Pregen::Loop.1} is equal to 16:
  39. set {Pregen::Time} to rounded down ((loop-number-1)/{Pregen::Radius})*50
  40. broadcast "{@P}{@CC} Progress: {@HC}%{Pregen::Time}%%%"
  41. set {Pregen::Loop.1} to 0
  42. loop ({Pregen::Radius}*2) times:
  43. {Pregen::Running} is not set:
  44. delete {Pregen::*}
  45. stop trigger
  46. add 1 to {Pregen::Loop.2}
  47. if {Pregen::Loop.2} is equal to 16:
  48. set {Pregen::Loop.2} to 0
  49. set {Pregen::x.coord} to ((loop-number-1)-{Pregen::Radius})
  50. set {Pregen::z.coord} to ((loop-number-2)-{Pregen::Radius})
  51. set {Pregen::Location} to (location at ({Pregen::x.coord}, 200, {Pregen::z.coord}) of the world ({Pregen::World}))
  52. while (block at {Pregen::Location}) is air:
  53. set {Pregen::Location} to location 1 below {Pregen::Location}
  54. if y-coordinate of {Pregen::Location} is less than 5:
  55. broadcast "{@P}{@CC} Void: skipping location"
  56. delete {Pregen::Location}
  57. if command sender is not online:
  58. broadcast "{@P}{@CC} Pregenning interrupted. {@HC}%command sender%{@CC} logged out."
  59. delete {Pregen::Running}
  60. teleport command sender to (location 1 above {Pregen::Location})
  61. add 1 to {Pregen::Time}
  62. wait {@Pregen.TP.Delay}
  63. broadcast "{@P}{@CC} Pregenning finished: ~{@HC}%{Pregen::Time}/16% minutes."
  64. delete {Pregen::*}
  65. set {Pregen::Location} to (location at (0, 255, 0) of the world (world of command sender))
  66. while (block at {Pregen::Location}) is air:
  67. set {Pregen::Location} to location 1 below {Pregen::Location}
  68. if y-coordinate of {Pregen::Location} is less than 5:
  69. broadcast "{@P}{@CC} Error: Could not teleport {@HC}%command sender%{@CC} to 0,0."
  70. delete {Pregen::Location}
  71. wait 1 tick
  72. teleport command sender to (location 1 above {Pregen::Location})
  73. message "{@P}{@CC} You were TPed to {@HC}0,%y-coordinate of command sender%,0!"
  74. execute console command "/pregen-sound random.explode"
  75.  
  76.  
  77. command /pregen-sound <text>:
  78. permission: skript.pregen
  79. trigger:
  80. loop all players:
  81. execute console command "/playsound %arg-1% loop-player ~ ~ ~ 1 1 1"
  82.  
  83.  
  84.  
  85. command /megascatter <integer> <world>:
  86. permission: skript.op
  87. trigger:
  88.  
  89. broadcast "{@P}{@HC} %command sender%{@CC}: {@HC}%arg-1%{@CC} in {@HC}%arg-2%!"
  90. set command sender's gamemode to creative
  91. set {FScatter::Running} to true
  92. set {FScatter::Radius} to arg-1
  93. set {FScatter::Radius} to arg-1
  94. set {FScatter::World} to arg-2
  95. set {FScatter::Loop.1} to 0
  96. set {FScatter::Loop.2} to 0
  97. set {FScatter::Count} to 0
  98. set {FScatter::Time} to 0
  99.  
  100.  
  101. set {_size} to (size of (all players))
  102. set {_size} to ({_size}/4)
  103. set {_players::*} to all players
  104. loop ({FScatter::Radius}*2) times:
  105. add 1 to {FScatter::Loop.1}
  106. if {FScatter::Loop.1} is equal to {_size}:
  107. set {FScatter::Time} to rounded down ((loop-number-1)/{FScatter::Radius})*50
  108. set {FScatter::Loop.1} to 0
  109. loop ({FScatter::Radius}*2) times:
  110. {FScatter::Running} is not set:
  111. delete {FScatter::*}
  112. stop trigger
  113. add 1 to {FScatter::Loop.2}
  114. if {FScatter::Loop.2} is equal to {_size}:
  115. set {FScatter::Loop.2} to 0
  116. set {FScatter::x.coord} to ((loop-number-1)-{FScatter::Radius})
  117. set {FScatter::z.coord} to ((loop-number-2)-{FScatter::Radius})
  118. set {FScatter::Location} to (location at ({FScatter::x.coord}, 200, {FScatter::z.coord}) of the world ({FScatter::World}))
  119. while (block at {FScatter::Location}) is air:
  120. set {FScatter::Location} to location 1 below {FScatter::Location}
  121. if y-coordinate of {FScatter::Location} is less than 5:
  122. broadcast "{@P}{@CC} Void: skipping location"
  123. delete {FScatter::Location}
  124. if command sender is not online:
  125. broadcast "{@P}{@CC} Scatter interrupted. {@HC}%command sender%{@CC} logged out."
  126. delete {FScatter::Running}
  127. teleport command sender to (location 1 above {FScatter::Location})
  128. set {FScatter::Player} to a random element out of {_players::*}
  129. while {FScatter::Player} is equal to the command sender:
  130. size of ({_players::*}) is greater than 1:
  131. set {FScatter::Player} to a random element out of {_players::*}
  132. set {FScatter::Player} to {FScatter::Player} parsed as offlineplayer
  133. teleport {FScatter::Player} to command sender
  134. add 1 to {FScatter::Time}
  135. wait {@Pregen.TP.Delay}
  136. delete {FScatter::*}
  137. set {FScatter::Location} to (location at (0, 255, 0) of the world (world of command sender))
  138. while (block at {FScatter::Location}) is air:
  139. set {FScatter::Location} to location 1 below {FScatter::Location}
  140. if y-coordinate of {FScatter::Location} is less than 5:
  141. broadcast "{@P}{@CC} Error: Could not teleport {@HC}%command sender%{@CC} to 0,0."
  142. delete {FScatter::Location}
  143. wait 1 tick
  144. teleport command sender to (location 1 above {FScatter::Location})
  145. message "{@P}{@CC} You were TPed to {@HC}0,%y-coordinate of command sender%,0!"
  146. execute console command "/pregen-sound random.explode"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement