Advertisement
fleft17

Untitled

Sep 15th, 2014
222
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[&dPregen&8]
  4. CC: &r
  5. HC: &b
  6. Pregen.TP.Delay: 1 tick #0.025 seconds
  7. Correct.Usage: /pregen &b<radius> <world>
  8. Broadcast.Messages: true
  9. WB.Fill.Speed: 100
  10. Coords.Spam.Chat: false
  11. Playsound: false
  12.  
  13.  
  14. command /skpregen [<integer>] [<world>]:
  15. permission: skript.op
  16. trigger:
  17. if {Pregen::Running} is true:
  18. if arg-1 is not set:
  19. delete {Pregen::Running}
  20. stop trigger
  21. else if arg-1 is set:
  22. message "{@P}{@HC} To cancel, use /pregen"
  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 3 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. command "/pregen-sound random.break"
  36. stop trigger
  37. wait 1 tick
  38. teleport command sender to (location 1 above {Pregen::Location})
  39. #command sender command "/wb set %arg-1%"
  40. broadcast "&a&k--------------{@P}&a&k--------------"
  41. broadcast "&a&k--{@CC} %command sender%: {@HC}%arg-1%{@CC} in {@HC}%arg-2%!"
  42. broadcast "&a&k--{@CC} Beginning pregen! Do not log out!"
  43. broadcast "&a&k--{@CC} Pregen Skript by Fleft"
  44. broadcast "&a&k--------------{@P}&a&k--------------"
  45. set command sender's gamemode to creative
  46. set {Pregen::Running} to true
  47. set {Pregen::Radius} to arg-1
  48. add 256 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. wait 1 second
  56. set {_count} to 3
  57. loop 3 times:
  58. broadcast "{@P}{@CC} Starting:{@HC} %{_count}%..."
  59. command "/pregen-sound note.harp"
  60. subtract 1 from {_count}
  61. wait 1 second
  62. loop ({Pregen::Radius}*2) times:
  63. add 1 to {Pregen::Loop.1}
  64. if {Pregen::Loop.1} is equal to 16:
  65. set {Pregen::Time} to rounded down ((((loop-number-1)/{Pregen::Radius})*50)-1)
  66. if {Pregen::Notify} was more than 5 seconds ago:
  67. set {Pregen::Notfy} to now
  68. if {@Broadcast.Messages} is true:
  69. broadcast "{@P}{@CC} Progress: {@HC}%{Pregen::Time}%%%"
  70. if {@Playsound} is true:
  71. command "/pregen-sound note.harp"
  72. else:
  73. message "{@P}{@CC} Progress: {@HC}%{Pregen::Time}%%%"
  74. set {Pregen::Loop.1} to 0
  75. loop ({Pregen::Radius}*2) times:
  76. {Pregen::Running} is not set:
  77. delete {Pregen::*}
  78. broadcast "{@P}{@HC} Cancelled!"
  79. command "/pregen-sound random.break"
  80. wait 5 ticks
  81. set {Pregen::Location} to (location at (0, 255, 0) of the world (world of command sender))
  82. while (block at {Pregen::Location}) is air:
  83. set {Pregen::Location} to location 1 below {Pregen::Location}
  84. if y-coordinate of {Pregen::Location} is less than 5:
  85. message "{@P}{@CC} Error: Could not teleport {@HC}%command sender%{@CC} to 0,0."
  86. wait 1 tick
  87. #teleport command sender to (location 1 above {Pregen::Location})
  88. message "{@P}{@CC} You were TPed to {@HC}0,%y-coordinate of command sender%,0!"
  89. delete {Pregen::Location}
  90. stop trigger
  91. add 1 to {Pregen::Loop.2}
  92. if {Pregen::Loop.2} is equal to 16:
  93. set {Pregen::Loop.2} to 0
  94. set {Pregen::x.coord} to ((loop-number-1)-{Pregen::Radius})
  95. set {Pregen::z.coord} to ((loop-number-2)-{Pregen::Radius})
  96. set {Pregen::Location} to (location at ({Pregen::x.coord}, 200, {Pregen::z.coord}) of the world ({Pregen::World}))
  97. while (block at {Pregen::Location}) is air:
  98. set {Pregen::Location} to location 1 below {Pregen::Location}
  99. if y-coordinate of {Pregen::Location} is less than 5:
  100. if {@Broadcast.Messages} is true:
  101. broadcast "{@P}{@CC} Void: skipping location"
  102. delete {Pregen::Location}
  103. if command sender is not online:
  104. broadcast "{@P}{@CC} Pregenning interrupted. {@HC}%command sender%{@CC} logged out."
  105. delete {Pregen::Running}
  106. teleport command sender to (location 1 above {Pregen::Location})
  107. if {@Coords.Spam.Chat} is true:
  108. message "{@P}{@CC} %{Pregen::Location}%"
  109. add 1 to {Pregen::Time}
  110. wait {@Pregen.TP.Delay}
  111. delete {Pregen::*}
  112. set {Pregen::Location} to (location at (0, 255, 0) of the world (world of command sender))
  113. while (block at {Pregen::Location}) is air:
  114. set {Pregen::Location} to location 1 below {Pregen::Location}
  115. if y-coordinate of {Pregen::Location} is less than 3:
  116. broadcast "{@P}{@CC} Error: Could not teleport {@HC}%command sender%{@CC} to 0,0."
  117. delete {Pregen::Location}
  118. wait 1 tick
  119. teleport command sender to (location 1 above {Pregen::Location})
  120. message "{@P}{@CC} You were TPed to {@HC}0,%y-coordinate of command sender%,0!"
  121. #command sender command "/wb set %arg-1%"
  122. #wait 1 tick
  123. #command sender command "/wb fill {@WB.Fill.Speed}"
  124. #wait 1 tick
  125. #command sender command "/wb fill confirm"
  126. broadcast "&a&k--------------{@P}&a&k--------------"
  127. broadcast "&a&k--{@HC} Pregenning has been completed!"
  128. broadcast "&a&k--------------{@P}&a&k--------------"
  129. loop 7 times:
  130. command "/pregen-sound fireworks.launch"
  131. command "/pregen-sound fireworks.twinkle"
  132. wait 3 ticks
  133. command "/pregen-sound random.levelup"
  134.  
  135.  
  136. command /pregen-sound <text>:
  137. permission: skript.pregen
  138. trigger:
  139. loop all players:
  140. execute console command "/playsound %arg% %loop-player% ~ ~ ~ 1 1 1"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement