Advertisement
fleft17

Untitled

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