Advertisement
fleft17

Untitled

Sep 15th, 2014
597
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.72 KB | None | 0 0
  1. options:
  2.  
  3. P: &8[&dPregen&8] #= Prefix =#
  4. CC: &r #= Main Chat Color =#
  5. HC: &b #= Highlight Color =#
  6. Correct.Usage: /pregen &b<radius> <world> #= How to not be dumb =#
  7.  
  8. Pregen.TP.Delay: 1 tick #= Don't change this =#
  9. Broadcast.Messages: true #= Broadcat Progress =#
  10. Coords.Spam.Chat: false #= Spams chat with every coordinate =#
  11.  
  12.  
  13. command /skpregen [<integer>] [<world>]:
  14. permission: skript.op
  15. trigger:
  16.  
  17.  
  18. #= Arguments =#
  19.  
  20. if {Pregen::Running} is true:
  21. if arg-1 is not set:
  22. delete {Pregen::Running}
  23. stop trigger
  24. else if arg-1 is set:
  25. message "{@P}{@HC} To cancel, use /pregen"
  26. stop trigger
  27. if arg-2 is not set:
  28. message "{@P}{@CC} {@Correct.Usage}"
  29. stop trigger
  30. loop 3 times:
  31. command "/pregen-sound note.harp"
  32. wait 3 ticks
  33.  
  34. #= TP to 0,0 =#
  35.  
  36. set {Pregen::Location} to (location at (0, 255, 0) of the world (arg-2))
  37. while (block at {Pregen::Location}) is air:
  38. set {Pregen::Location} to location 1 below {Pregen::Location}
  39. if y-coordinate of {Pregen::Location} is less than 3:
  40. message "{@P}{@CC} Error: Could not teleport {@HC}%command sender%{@CC} to 0,0."
  41. teleport command sender to (location 1 above {Pregen::Location})
  42.  
  43. #= Variables + Gamemode Creative =#
  44.  
  45. set command sender's gamemode to creative
  46. set {Pregen::Running} to true
  47. set {Pregen::Radius} to arg-1
  48. add 128 to {Pregen::Radius}
  49. set {Pregen::World} to arg-2
  50. set {Pregen::Loop.1} to 0
  51. set {Pregen::Loop.2} to 0
  52. set {Pregen::Count} to 0
  53. set {Pregen::Time} to 0
  54. set {Pregen::Notify} to now
  55.  
  56. #= Broadcast =#
  57.  
  58. loop 6 times:
  59. message "{@P}{@CC} Remove your world border!"
  60. wait 2 ticks
  61. broadcast "&a&k--------------{@P}&a&k--------------"
  62. broadcast "&a&k--{@CC} %command sender%: {@HC}%arg-1%{@CC} in {@HC}%arg-2%!"
  63. broadcast "&a&k--{@CC} Beginning pregen! Do not log out!"
  64. if command sender is "Fleft":
  65. broadcast "&a&k--{@CC} Pregen Skript by {@HC}You"
  66. else:
  67. broadcast "&a&k--{@CC} Pregen Skript by {@HC}Fleft"
  68. broadcast "&a&k--{@CC} Use /skpregen to cancel at any time!"
  69. broadcast "&a&k--------------{@P}&a&k--------------"
  70. wait 1 second
  71. set {_count} to 3
  72. loop 3 times:
  73. broadcast "{@P}{@CC} Starting:{@HC} %{_count}%..."
  74. command "/pregen-sound note.harp"
  75. subtract 1 from {_count}
  76. wait 1 second
  77.  
  78.  
  79. #= Literally the Pregen =#
  80.  
  81. loop ({Pregen::Radius}*2) times:
  82. add 1 to {Pregen::Loop.1}
  83. if {Pregen::Loop.1} is equal to 16:
  84. set {Pregen::Time} to rounded down ((((loop-number-1)/{Pregen::Radius})*50)-1)
  85. if {Pregen::Notify} was more than 5 seconds ago:
  86. set {Pregen::Notfy} to now
  87. if {@Broadcast.Messages} is true:
  88. broadcast "{@P}{@CC} Progress: {@HC}%{Pregen::Time}%%%"
  89. else:
  90. message "{@P}{@CC} Progress: {@HC}%{Pregen::Time}%%%"
  91. set {Pregen::Loop.1} to 0
  92. loop ({Pregen::Radius}*2) times:
  93. {Pregen::Running} is not set:
  94. delete {Pregen::*}
  95. broadcast "{@P}{@HC} Cancelled!"
  96. command "/pregen-sound random.break"
  97. wait 5 ticks
  98. set {Pregen::Location} to (location at (0, 255, 0) of the world (world of command sender))
  99. while (block at {Pregen::Location}) is air:
  100. set {Pregen::Location} to location 1 below {Pregen::Location}
  101. if y-coordinate of {Pregen::Location} is less than 3:
  102. message "{@P}{@CC} Error: Could not teleport {@HC}%command sender%{@CC} to 0,0."
  103. wait 1 tick
  104. teleport command sender to (location 1 above {Pregen::Location})
  105. message "{@P}{@CC} You were TPed to {@HC}0,%y-coordinate of command sender%,0!"
  106. delete {Pregen::Location}
  107. stop trigger
  108. add 1 to {Pregen::Loop.2}
  109. if {Pregen::Loop.2} is equal to 16:
  110. set {Pregen::Loop.2} to 0
  111. set {Pregen::x.coord} to ((loop-number-1)-{Pregen::Radius})
  112. set {Pregen::z.coord} to ((loop-number-2)-{Pregen::Radius})
  113. set {Pregen::Location} to (location at ({Pregen::x.coord}, 255, {Pregen::z.coord}) of the world ({Pregen::World}))
  114. while (block at {Pregen::Location}) is air:
  115. set {Pregen::Location} to location 1 below {Pregen::Location}
  116. if y-coordinate of {Pregen::Location} is less than 3:
  117. message "{@P}{@CC} Error: Void: Skipping location"
  118. delete {Pregen::Location}
  119. if command sender is not online:
  120. broadcast "{@P}{@CC} Pregenning interrupted. {@HC}%command sender%{@CC} logged out."
  121. delete {Pregen::Running}
  122. teleport command sender to (location 1 above {Pregen::Location})
  123. if {@Coords.Spam.Chat} is true:
  124. message "{@P}{@CC} %{Pregen::Location}%"
  125. add 1 to {Pregen::Time}
  126. wait {@Pregen.TP.Delay}
  127.  
  128. #= Deletion of Variable =#
  129.  
  130. delete {Pregen::*}
  131.  
  132. #= Final TP to 0,0 =#
  133. set {_FinalLoc} to (location at (0, 256, 0) of the world (world of command sender))
  134. while (block at {_FinalLoc}) is air:
  135. set {_FinalLoc} to location 1 below {_FinalLoc}
  136. if y-coordinate of {_FinalLoc} is less than 3:
  137. message "{@P}{@CC} Error: Could not teleport {@HC}%command sender%{@CC} to 0,0."
  138. wait 1 tick
  139. teleport command sender to (location 1 above {_FinalLoc})
  140.  
  141. #= Final Broadcast =#
  142.  
  143. message "{@P}{@CC} You were TPed to {@HC}0,%y-coordinate of command sender%,0!"
  144. broadcast "&a&k--------------{@P}&a&k--------------"
  145. broadcast "&a&k--{@HC} Pregenning has been completed!"
  146. broadcast "&a&k--{@CC} Reapply your {@HC}Worldborder!"
  147. broadcast "&a&k--------------{@P}&a&k--------------"
  148. loop 7 times:
  149. command "/pregen-sound fireworks.launch"
  150. command "/pregen-sound fireworks.twinkle"
  151. wait 4 ticks
  152.  
  153. #= Sound Command =#
  154.  
  155. command /pregen-sound <text>:
  156. permission: skript.pregen
  157. trigger:
  158. loop all players:
  159. execute console command "/playsound %arg% %loop-player% ~ ~ ~ 1 1 1"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement