fleft17

Untitled

Sep 14th, 2014
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.40 KB | None | 0 0
  1. options:
  2.  
  3. P: &8[&7ChunkApoc&8]
  4. CC: &a
  5. HC: &6
  6. Tick.Delay: 25 ticks
  7. Correct.Usage: /chunk <radius> <world> <percent>
  8. Broadcast.Messages: false
  9.  
  10. command /chunkapoc [<integer>] [<world>] [<integer>]:
  11. permission: skript.op
  12. trigger:
  13. if {ChunkApoc::Running} is true:
  14. if arg-1 is not set:
  15. delete {ChunkApoc::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 run this 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. if arg-2 is not set:
  26. message "{@P}{@CC} {@Correct.Usage}"
  27. loop 3 times:
  28. command "/chunkapoc-sound note.harp"
  29. wait 4 ticks
  30. broadcast "{@P}{@CC}&r&k----------------------------------"
  31. broadcast "{@P}{@HC} %command sender%{@CC}: {@HC}%arg-1%{@CC} in {@HC}%arg-2%!"
  32. broadcast "{@P}{@CC} Beginning ChunkApoc! There may be lag! Do not log out!"
  33. broadcast "{@P}{@HC} ChunkApoc Skript by Fleft"
  34. broadcast "{@P}{@CC}&r&k----------------------------------"
  35. set command sender's gamemode to creative
  36. set {ChunkApoc::Running} to true
  37. set {ChunkApoc::Radius} to arg-1
  38. set {ChunkApoc::World} to arg-2
  39. set {ChunkApoc::Percent} to arg-3
  40. set {ChunkApoc::Loop.1} to 0
  41. set {ChunkApoc::Loop.2} to 0
  42. set {ChunkApoc::Count} to 0
  43. set {ChunkApoc::Time} to 0
  44. set {ChunkApoc::Notify} to now
  45. wait 1 second
  46. set {_count} to 3
  47. loop 3 times:
  48. broadcast "{@P}{@CC} Starting:{@HC} %{_count}%..."
  49. command "/chunkapoc-sound note.harp"
  50. subtract 1 from {_count}
  51. wait 1 second
  52. loop ({ChunkApoc::Radius}*2) times:
  53. add 1 to {ChunkApoc::Loop.1}
  54. if {ChunkApoc::Loop.1} is equal to 16:
  55. set {ChunkApoc::Time} to rounded down ((loop-number-1)/{ChunkApoc::Radius})*50
  56. if {@Broadcast.Messages} is true:
  57. if {ChunkApoc::Notify} was more than 5 seconds ago:
  58. broadcast "{@P}{@CC} Progress: {@HC}%{ChunkApoc::Time}%%%"
  59. set {ChunkApoc::Notfy} to now
  60. command "/chunkapoc-sound note.harp"
  61. set {ChunkApoc::Loop.1} to 0
  62. wait 1 tick
  63. loop ({ChunkApoc::Radius}*2) times:
  64. {ChunkApoc::Running} is not set:
  65. delete {ChunkApoc::*}
  66. broadcast "{@P}{@HC} Cancelled!"
  67. command "/chunkapoc-sound random.break"
  68. wait 5 ticks
  69. stop trigger
  70. add 1 to {ChunkApoc::Loop.2}
  71. if {ChunkApoc::Loop.2} is equal to 16:
  72. set {ChunkApoc::Loop.2} to 0
  73. chance of {ChunkApoc::Percent}%:
  74. loop 256 times:
  75. set {ChunkApoc::x.coord} to ((loop-number-1)-{ChunkApoc::Radius})
  76. set {ChunkApoc::z.coord} to ((loop-number-2)-{ChunkApoc::Radius})
  77. set {ChunkApoc::Location} to (location at ({ChunkApoc::x.coord}, 255, {ChunkApoc::z.coord}) of the world ({ChunkApoc::World}))
  78. loop blocks from (block at (the location at ({ChunkApoc::x.coord}-0.5), (256-(loop-number-3)), ({ChunkApoc::z.coord}-0.5) of the world {ChunkApoc::World})) to (block at (the location at ({ChunkApoc::x.coord}-0.5), (256-(loop-number-3)), (0-{ChunkApoc::z.coord}+0.5) of the world {ChunkApoc::World})):
  79. loop blocks from loop-block-1 to (block 16 west of loop-block-1):
  80. set loop-block-2 to air
  81. #teleport command sender to (location 1 above {ChunkApoc::Location})
  82. add 1 to {ChunkApoc::Time}
  83. wait {@Tick.Delay}
  84. broadcast "{@P}{@CC} Finished"
  85. delete {ChunkApoc::*}
  86. set {ChunkApoc::Location} to (location at (0, 255, 0) of the world (world of command sender))
  87. while (block at {ChunkApoc::Location}) is air:
  88. set {ChunkApoc::Location} to location 1 below {ChunkApoc::Location}
  89. if y-coordinate of {ChunkApoc::Location} is less than 5:
  90. broadcast "{@P}{@CC} Error: Could not teleport {@HC}%command sender%{@CC} to 0,0."
  91. delete {ChunkApoc::Location}
  92. wait 1 tick
  93. loop 3 times:
  94. command "/chunkapoc-sound note.harp"
  95. wait 3 ticks
  96. broadcast "{@P}{@CC}&r&k----------------------------------"
  97. broadcast "{@P}{@CC} Automatically finishing chunkapoc using"
  98. broadcast "{@P}{@HC} WorldBorder!{@CC} May be small lag!"
  99. broadcast "{@P}{@CC}&r&k----------------------------------"
  100. execute console command "/chunkapoc-sound random.explode"
  101.  
  102.  
  103. command /chunkapoc-sound <text>:
  104. permission: skript.chunkapoc
  105. trigger:
  106. loop all players:
  107. execute console command "/playsound %arg% %loop-player% ~ ~ ~ 1 1 1"
  108.  
  109.  
  110. on physics:
  111. {ChunkApoc::Running} is true:
  112. cancel the event
Advertisement
Add Comment
Please, Sign In to add comment