Create differents borders

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

sagp15

Member
Jun 16, 2017
22
1
0
22
Hello everyone

I was looking for a way to make a player with some permission can not leave an area of the world.

For example: Let the center of the area be x: 0 z: 0 and that the players can not cross a border of 100x100.

I know there are plugins to create a SINGLE border but I would need to create several borders

an idea of the code would be the following:

code_language.skript:
on any movement:
   if player doesn't has permission "border.100":
      #if the player is outside the border 100:
          #teleport the player to x: 0 z: 0

The above is an example and it does not work
 
Could you show me an example of how it is used?
code_language.skript:
command /barrier [<player>]:
    trigger:
        set client border size of player to 5
        set client border warning distance of arg-1 to 100
        set client border center location of arg-1 to arg-1's location
 
code_language.skript:
command /barrier [<player>]:
    trigger:
        set client border size of player to 5
        set client border warning distance of arg-1 to 100
        set client border center location of arg-1 to arg-1's location
and how can I make a variable define the center
code_language.skript:
command /setspawn:
    permission: permission.text
    trigger:
        set {UHC.Center} to player's location
        
command /barrier [<player>]:
    trigger:
        set client "world" border center {UHC.Center} for arg-1
        set client border size of arg-1 to 200
        set client border warning distance of arg-1 to 100
 
and how can I make a variable define the center
code_language.skript:
command /setspawn:
    permission: permission.text
    trigger:
        set {UHC.Center} to player's location
       
command /barrier [<player>]:
    trigger:
        set client "world" border center {UHC.Center} for arg-1
        set client border size of arg-1 to 200
        set client border warning distance of arg-1 to 100

Maybe this? I don't tested it, and I know this thread is old but it's still not solved so I wanna help
code_language.skript:
command /setspawn:
    permission: permission.text
    trigger:
        set {UHC.Center} to player's location
      
command /barrier [<player>]:
    trigger:
        set client border center of arg-1 to {UHC.Center}
        set client border size of arg-1 to 200
        set client border warning distance of arg-1 to 100
 
Status
Not open for further replies.