Solved region

  • 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.

EricDasBrot

Member
Jun 1, 2017
26
0
0
28
Hello. How can I set a region and when I leave it, that I will automatically be teleported to another world? Example: /pos1 , /pos2
 
code_language.skript:
command /region <text> <text>:
    usage: /region <pos1|pos2> <region-name>
    trigger:
        if arg 1 is "pos1" or "pos2":
            set {region::%arg 2%::%arg 1%} to player's location
            message "&aYou set %arg 1% of region with name %arg 2% to %player's location%"
on any movement:
    loop {region::*}
        if location of player is within {region::%loop-index%::pos1} to {region::%loop-index%::pos2}:
            set {player::%player%::region} to loop-index
            message "You're in region %loop-index%"
        else:
            message "You're not in region %loop-index%"
            if {player::%player%::region} is not loop-index:
                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.
 
  • Like
Reactions: Uzumaki
Status
Not open for further replies.