Guest User

Big Crack SK

a guest
Jul 31st, 2015
609
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. #This skript was written by Fleft with inspiration from other bigcrack skripts.
  2.  
  3. options:
  4. P: &7[&bBigcrack&7]&r
  5. Start1: &e%command sender%&r in &e%arg-3%:&r Radius: &b%arg-1%&r | Width: &b%arg-2%
  6. Start2: Get away from the Bigcrack! Your game may crash!
  7. Cancel: Crack generation cancelled by &e%{Bigcrack::Cancel}%!
  8. Cancelling: Cancelling Bigcrack generation!
  9. Message.Delay: 2 seconds
  10.  
  11. command /bigcrack <text> [<integer>] [<world>]:
  12. usage: /bigcrack <map radius> <crack radius> <world> | /bigcrack cancel
  13. permission: skript.bigcrack
  14. trigger:
  15. if arg-1 is "cancel":
  16. if {Bigcrack::Running} is true:
  17. set {Bigcrack::Cancel} to true
  18. stop trigger
  19. else:
  20. message "{@P} No generation is in progress!"
  21. stop trigger
  22. if arg-1 is set:
  23. if arg-2 is not set:
  24. message "{@P} /bigcrack <map radius> <crack radius> <world>"
  25. stop trigger
  26.  
  27. broadcast "{@P} {@Start1}"
  28. broadcast "{@P} {@Start2}"
  29. set {Bigcrack::Running} to true
  30. set {Bigcrack::MapRadius} to arg-1 parsed as integer
  31. set {Bigcrack::CrackRadius} to arg-2
  32. set {Bigcrack::World} to arg-3
  33. set {Bigcrack::TotalSlice} to 0
  34. set {Bigcrack::Slice} to 0
  35. if {Bigcrack::MapRadius} is less than 250:
  36. set {Bigcrack::Buffer} to 8
  37. else if {Bigcrack::MapRadius} is less than 500:
  38. set {Bigcrack::Buffer} to 4
  39. else if {Bigcrack::MapRadius} is less than 1000:
  40. set {Bigcrack::Buffer} to 2
  41. else:
  42. set {Bigcrack::Buffer} to 1
  43. wait 5 ticks
  44. set {Bigcrack::Tick} to now
  45. set {Bigcrack::Notify} to now
  46.  
  47. loop 256 times:
  48. if {Bigcrack::Cancel} is set:
  49. set {Bigcrack::Cancel} to (name of command sender)
  50. message "{@P} {@Cancelling}"
  51. broadcast "{@P} {@Cancel}"
  52. delete {Bigcrack::*}
  53. stop trigger
  54.  
  55. loop blocks from (block at (the location at ({Bigcrack::MapRadius}-0.5), (256-(loop-number)), ({Bigcrack::CrackRadius}-0.5) of the world {Bigcrack::World})) to (block at (the location at ({Bigcrack::MapRadius}-0.5), (256-(loop-number)), (0-{Bigcrack::CrackRadius}+0.5) of the world {Bigcrack::World})):
  56. loop blocks from loop-block-1 to (block (({Bigcrack::MapRadius}*2)-1) west of loop-block-1):
  57. set loop-block-2 to air
  58.  
  59. add 1 to {Bigcrack::Slice}
  60. if {Bigcrack::Slice} is equal to {Bigcrack::Buffer}:
  61. add {Bigcrack::Slice} to {Bigcrack::TotalSlice}
  62. set {Bigcrack::Slice} to 0
  63. if {Bigcrack::Notify} was more than {@Message.Delay} ago:
  64. set {Bigcrack::Notify} to now
  65. broadcast "{@P} Progress: &eSlice %(loop-number)%/256"
  66. wait 1 tick
  67.  
  68. broadcast "{@P} Crack generation finished!"
  69. delete {Bigcrack::*}
  70.  
  71.  
  72. on physics:
  73. {Bigcrack::Running} is true:
  74. cancel the event
Add Comment
Please, Sign In to add comment