1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved region

Discussion in 'Skript' started by EricDasBrot, Jun 5, 2017.

Thread Status:
Not open for further replies.
  1. EricDasBrot

    EricDasBrot Member

    Joined:
    Jun 1, 2017
    Messages:
    26
    Likes Received:
    0
    Hello. How can I set a region and when I leave it, that I will automatically be teleported to another world? Example: /pos1 , /pos2
     
  2. Best Answer:
    Post #2 by ShaneBee, Jun 7, 2017
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    Code (Skript):
    1. command /region <text> <text>:
    2.     usage: /region <pos1|pos2> <region-name>
    3.     trigger:
    4.         if arg 1 is "pos1" or "pos2":
    5.             set {region::%arg 2%::%arg 1%} to player's location
    6.             message "&aYou set %arg 1% of region with name %arg 2% to %player's location%"
    7. on any movement:
    8.     loop {region::*}
    9.         if location of player is within {region::%loop-index%::pos1} to {region::%loop-index%::pos2}:
    10.             set {player::%player%::region} to loop-index
    11.             message "You're in region %loop-index%"
    12.         else:
    13.             message "You're not in region %loop-index%"
    14.             if {player::%player%::region} is not loop-index:
    15.                 message "You left region %{player::%player%::region}%"
    Keep in mind most of this is to display examples. If you actually use this coding, the player will get spammed alot.
     
    Uzumaki likes this.
Thread Status:
Not open for further replies.

Share This Page

Loading...