Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Dependencies: Skript 2.2, SkQuery and WorldBorder
- options:
- height: 5
- block: BEDROCK
- blockless: air or long grass
- function Border(i: int, w: text):
- set {_aux} to {_i} + {_i} + 1
- set {_aux2} to 0 - {_i}
- make console execute command "/wb %{_w}% clear"
- make console execute command "/wb shape rectangular"
- make console execute command "/wb %{_w}% setcorners %{_i}% %{_i}% -%{_i}% -%{_i}%"
- set {_loc} to location at {_i}, 150, {_i} of the world ("%{_w}%" parsed as world)
- loop {_aux} times:
- while block at {_loc} is {@blockless}:
- remove 1 from y-location of {_loc}
- add {@height} to y-location of {_loc}
- loop {@height} times:
- set block at {_loc} to {@block}
- remove 1 from y-location of {_loc}
- wait 0.2 ticks
- remove 1 from x-location of {_loc}
- set y-location of {_loc} to 150
- set {_loc} to location at {_aux2}, 150, {_aux2} of the world ("%{_w}%" parsed as world)
- loop {_aux} times:
- while block at {_loc} is {@blockless}:
- remove 1 from y-location of {_loc}
- add {@height} to y-location of {_loc}
- loop {@height} times:
- set block at {_loc} to {@block}
- remove 1 from y-location of {_loc}
- wait 0.2 ticks
- add 1 to x-location of {_loc}
- set y-location of {_loc} to 150
- set {_loc} to location at {_i}, 150, {_i} of the world ("%{_w}%" parsed as world)
- remove 1 from z-location of {_loc}
- loop ({_aux} -2) times:
- while block at {_loc} is {@blockless}:
- remove 1 from y-location of {_loc}
- add {@height} to y-location of {_loc}
- loop {@height} times:
- set block at {_loc} to {@block}
- remove 1 from y-location of {_loc}
- wait 0.2 ticks
- remove 1 from z-location of {_loc}
- set y-location of {_loc} to 150
- set {_loc} to location at {_aux2}, 150, {_aux2} of the world ("%{_w}%" parsed as world)
- add 1 to z-location of {_loc}
- loop ({_aux} -2) times:
- while block at {_loc} is {@blockless}:
- remove 1 from y-location of {_loc}
- add {@height} to y-location of {_loc}
- loop {@height} times:
- set block at {_loc} to {@block}
- remove 1 from y-location of {_loc}
- wait 0.2 ticks
- add 1 to z-location of {_loc}
- set y-location of {_loc} to 150
- # Example using the function
- command /border [<int>] [<text>]:
- permission: border.admin
- trigger:
- if arg-1 is set:
- if arg-2 is set:
- Border(arg-1, arg-2)
- else:
- send "&c/border <size> <world>"
- else:
- send "&c/border <size> <world>"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement