Advertisement
Guest User

Untitled

a guest
Feb 26th, 2017
421
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1. # Dependencies: Skript 2.2, SkQuery and WorldBorder
  2.  
  3. options:
  4. height: 5
  5. block: BEDROCK
  6. blockless: air or long grass
  7.  
  8. function Border(i: int, w: text):
  9. set {_aux} to {_i} + {_i} + 1
  10. set {_aux2} to 0 - {_i}
  11.  
  12. make console execute command "/wb %{_w}% clear"
  13. make console execute command "/wb shape rectangular"
  14. make console execute command "/wb %{_w}% setcorners %{_i}% %{_i}% -%{_i}% -%{_i}%"
  15.  
  16. set {_loc} to location at {_i}, 150, {_i} of the world ("%{_w}%" parsed as world)
  17. loop {_aux} times:
  18. while block at {_loc} is {@blockless}:
  19. remove 1 from y-location of {_loc}
  20. add {@height} to y-location of {_loc}
  21. loop {@height} times:
  22. set block at {_loc} to {@block}
  23. remove 1 from y-location of {_loc}
  24. wait 0.2 ticks
  25. remove 1 from x-location of {_loc}
  26. set y-location of {_loc} to 150
  27.  
  28. set {_loc} to location at {_aux2}, 150, {_aux2} of the world ("%{_w}%" parsed as world)
  29. loop {_aux} times:
  30. while block at {_loc} is {@blockless}:
  31. remove 1 from y-location of {_loc}
  32. add {@height} to y-location of {_loc}
  33. loop {@height} times:
  34. set block at {_loc} to {@block}
  35. remove 1 from y-location of {_loc}
  36. wait 0.2 ticks
  37. add 1 to x-location of {_loc}
  38. set y-location of {_loc} to 150
  39.  
  40. set {_loc} to location at {_i}, 150, {_i} of the world ("%{_w}%" parsed as world)
  41. remove 1 from z-location of {_loc}
  42. loop ({_aux} -2) times:
  43. while block at {_loc} is {@blockless}:
  44. remove 1 from y-location of {_loc}
  45. add {@height} to y-location of {_loc}
  46. loop {@height} times:
  47. set block at {_loc} to {@block}
  48. remove 1 from y-location of {_loc}
  49. wait 0.2 ticks
  50. remove 1 from z-location of {_loc}
  51. set y-location of {_loc} to 150
  52.  
  53. set {_loc} to location at {_aux2}, 150, {_aux2} of the world ("%{_w}%" parsed as world)
  54. add 1 to z-location of {_loc}
  55. loop ({_aux} -2) times:
  56. while block at {_loc} is {@blockless}:
  57. remove 1 from y-location of {_loc}
  58. add {@height} to y-location of {_loc}
  59. loop {@height} times:
  60. set block at {_loc} to {@block}
  61. remove 1 from y-location of {_loc}
  62. wait 0.2 ticks
  63. add 1 to z-location of {_loc}
  64. set y-location of {_loc} to 150
  65.  
  66. # Example using the function
  67.  
  68. command /border [<int>] [<text>]:
  69. permission: border.admin
  70. trigger:
  71. if arg-1 is set:
  72. if arg-2 is set:
  73. Border(arg-1, arg-2)
  74. else:
  75. send "&c/border <size> <world>"
  76. else:
  77. send "&c/border <size> <world>"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement