Advertisement
fleft17

Untitled

Sep 14th, 2014
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.23 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 ({ChunkApoc::Radius}*2) times:
  48. add 1 to {ChunkApoc::Loop.1}
  49. if {ChunkApoc::Loop.1} is equal to 15:
  50. set {ChunkApoc::Time} to rounded down ((loop-number-1)/{ChunkApoc::Radius})*50
  51. if {@Broadcast.Messages} is true:
  52. if {ChunkApoc::Notify} was more than 5 seconds ago:
  53. broadcast "{@P}{@CC} Progress: {@HC}%{ChunkApoc::Time}%%%"
  54. set {ChunkApoc::Notfy} to now
  55. command "/chunkapoc-sound note.harp"
  56. set {ChunkApoc::Loop.1} to 0
  57. wait 1 tick
  58. loop ({ChunkApoc::Radius}*2) times:
  59. {ChunkApoc::Running} is not set:
  60. delete {ChunkApoc::*}
  61. broadcast "{@P}{@HC} Cancelled!"
  62. command "/chunkapoc-sound random.break"
  63. wait 5 ticks
  64. stop trigger
  65. add 1 to {ChunkApoc::Loop.2}
  66. if {ChunkApoc::Loop.2} is equal to 16:
  67. set {ChunkApoc::Loop.2} to 0
  68. chance of {ChunkApoc::Percent}%:
  69. loop 256 times:
  70. set {ChunkApoc::x.coord} to ((loop-number-1)-{ChunkApoc::Radius})
  71. set {ChunkApoc::z.coord} to ((loop-number-2)-{ChunkApoc::Radius})
  72. set {ChunkApoc::Location} to (location at ({ChunkApoc::x.coord}, 255, {ChunkApoc::z.coord}) of the world ({ChunkApoc::World}))
  73. loop blocks from (block at (the location at ({ChunkApoc::x.coord}), (256-(loop-number-3)), ({ChunkApoc::z.coord}) of the world {ChunkApoc::World})) to (block at (the location at ({ChunkApoc::x.coord}), (256-(loop-number-3)), ({ChunkApoc::z.coord}-16) of the world {ChunkApoc::World})):
  74. loop blocks from loop-block-1 to (block 16 west of loop-block-1):
  75. set loop-block-2 to air
  76. #teleport command sender to (location 1 above {ChunkApoc::Location})
  77. add 1 to {ChunkApoc::Time}
  78. wait {@Tick.Delay}
  79. broadcast "{@P}{@CC} Finished"
  80. delete {ChunkApoc::*}
  81. set {ChunkApoc::Location} to (location at (0, 255, 0) of the world (world of command sender))
  82. while (block at {ChunkApoc::Location}) is air:
  83. set {ChunkApoc::Location} to location 1 below {ChunkApoc::Location}
  84. if y-coordinate of {ChunkApoc::Location} is less than 5:
  85. broadcast "{@P}{@CC} Error: Could not teleport {@HC}%command sender%{@CC} to 0,0."
  86. delete {ChunkApoc::Location}
  87. wait 1 tick
  88. loop 3 times:
  89. command "/chunkapoc-sound note.harp"
  90. wait 3 ticks
  91. broadcast "{@P}{@CC}&r&k----------------------------------"
  92. broadcast "{@P}{@CC} Automatically finishing chunkapoc using"
  93. broadcast "{@P}{@HC} WorldBorder!{@CC} May be small lag!"
  94. broadcast "{@P}{@CC}&r&k----------------------------------"
  95. execute console command "/chunkapoc-sound random.explode"
  96.  
  97.  
  98. command /chunkapoc-sound <text>:
  99. permission: skript.chunkapoc
  100. trigger:
  101. loop all players:
  102. execute console command "/playsound %arg% %loop-player% ~ ~ ~ 1 1 1"
  103.  
  104.  
  105. on physics:
  106. {ChunkApoc::Running} is true:
  107. cancel the event
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement