teleport all players in region skript

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

Coollymxja

New Member
Jul 17, 2020
8
0
1
24
Hey,
how can i teleport all players in a WorldGuard region?
teleport all players in region "XY" to {lobby}

is not working
 
something like that i guess
Code:
loop all players:
     if "%region at loop-player%" contains "Spawn":
         teleport loop-player to {_spawn}
 
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:
command /setregionspawn [<text>]:
    permission: plugin.setregionspawn
    executable by: player
    aliases: /srs
    description: Region spawn location set!
    trigger:
        if arg 1 is not set:
            send "Region name is not set" to player
            stop
        if arg 1 is set:
            if {region.spawn.%arg 1%} is not set:
                set {region.spawn.%arg 1%} to location of player
                send "Spawn location for your region wase create" to player
                stop
            else:
                send "Spawn location for your region already exists" to player
                stop

loop all players:
     if "%region at loop-player%" contains "Spawn":
         teleport loop-player to {region.spawn.%region at loop-player%} #or {region.spawn.Spawn}
 
Status
Not open for further replies.