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.

teleport all players in region skript

Discussion in 'Skript' started by Coollymxja, Sep 18, 2020.

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

    Coollymxja New Member

    Joined:
    Jul 17, 2020
    Messages:
    8
    Likes Received:
    0
    Hey,
    how can i teleport all players in a WorldGuard region?
    teleport all players in region "XY" to {lobby}

    is not working
     
  2. neolia

    neolia New Member

    Joined:
    Sep 19, 2020
    Messages:
    5
    Likes Received:
    0
    something like that i guess
    Code (Text):
    1. loop all players:
    2.      if "%region at loop-player%" contains "Spawn":
    3.          teleport loop-player to {_spawn}
    4.  
     
  3. SebyHas

    SebyHas New Member

    Joined:
    Mar 30, 2018
    Messages:
    9
    Likes Received:
    0
    The WG region, is a region ... is not a location, but have much possible locations in this region, but you need to specify a location, need to find a place where the loop-player to be teleported.
    I "create" a little example for you (it's a part of Essentials Skript, just edited)
    You can find only a block, only a location, and teleport to this, you can loop all block in this region and teleport a player to this block ... or above it, i recommend :emoji_grinning: .
    Code (Text):
    1. command /setregionspawn [<text>]:
    2.     permission: plugin.setregionspawn
    3.     executable by: player
    4.     aliases: /srs
    5.     description: Region spawn location set!
    6.     trigger:
    7.         if arg 1 is not set:
    8.             send "Region name is not set" to player
    9.             stop
    10.         if arg 1 is set:
    11.             if {region.spawn.%arg 1%} is not set:
    12.                 set {region.spawn.%arg 1%} to location of player
    13.                 send "Spawn location for your region wase create" to player
    14.                 stop
    15.             else:
    16.                 send "Spawn location for your region already exists" to player
    17.                 stop
    18.  
    19. loop all players:
    20.      if "%region at loop-player%" contains "Spawn":
    21.          teleport loop-player to {region.spawn.%region at loop-player%} #or {region.spawn.Spawn}
     
Thread Status:
Not open for further replies.

Share This Page

Loading...