TP player if they quit in a 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.

LimmaBeanz

New Member
May 16, 2021
5
0
1
21
I currently have this idea that is 99% complete, but I was thinking of the player being able to quit, and then either getting stuck in the region or being able to explore a place they shouldn't be able to. There are obviously ways to tp anyone who leaves to spawn or something, but I need them to only TP when they are in a specific region, or in specific coordinates. Thanks to anyone who can give me some advice!
 
I'm pretty sure there are WorldGuard flags for exit and entry that you can set to deny. If you still want finer control over the regions, try using the region exit/enter event: https://docs.skunity.com/syntax/search/id:4866

Regions apparently don't always have a name, so you'll have to put the region itself into text.
 
I'm pretty sure there are WorldGuard flags for exit and entry that you can set to deny. If you still want finer control over the regions, try using the region exit/enter event: https://docs.skunity.com/syntax/search/id:4866

Regions apparently don't always have a name, so you'll have to put the region itself into text.

Sorry for the late reply, but I want the player to be able to enter the region and all that. However, if a player logs out and they're STILL in that region, I want them to be teleported away out of that region to specific coordinates (like spawn)
 
Code:
on join:
    wait 1 second
    if "%region at player%" contains "forbidden-region":
        #teleport the player to spawn

This uses worldguard - not tested, not sure if it works
 
Status
Not open for further replies.