#Skript teleports players even after they leave the region

1 messages · Page 1 of 1 (latest)

limber sable
#

So i have a koth arena, I want to make a 5minute countdown for them to get teleported to spawn however if they were previously at the "kotharena" region, they will still get telported to spawn after 5 minutes.

#

I cant paste the code for some reason

half wasp
#

add the player to a list when they run the command to be a part of the koth event; then when your timer ends, loop the list and teleport loop-value (the player) to the location you need

half wasp
#

do you know what a Skript list is?

limber sable
#

I do know what it is, idk how to make it

half wasp
#

add player to {SomeList::*} will add the player to the list {SomeList::*}. if the list wasn't already created previously, it will be created for you

limber sable
half wasp
#

is there a command for them to join the Koth event? or how do they join it?

limber sable
half wasp
#

gotcha. is the portal used with Skript or a plugin?

limber sable
#

plugin, when player enters the portal it just minecraft:tps them

half wasp
#

gotcha. well, you can change things slightly and turn your WorldGuard teleport into a Skript command that teleports them, and that's where you can add the player to a list.

#

something like this

limber sable
#

on koth start, it flags it and allows them to enter

half wasp
#
command kothtp:
  trigger:
    add player to {koth::*}
    teleport player to location(0, 64, 0, world "world")```
#

you can run this command when they go through the portal (as the player, not console)

limber sable
#

right, yeah done that

half wasp
#

so other players can't run it, you can have a delay in the code that then detects the region they are in (in this case, the koth area itself), and if it's that region, then do the code to add them

limber sable
#

Okay yeah done that, how can i add the list into the /kothtpall trigger?

#

and how can i remove the player from the list if they leave the region

half wasp
#

on region leave for the last one, then just remove player from {koth::*}

#

if you aren't going to need the list after you teleport all the players, you can just delete {koth::*} and it will delete the list

limber sable
#

how can i specify the region?

half wasp
#

"%region at loop-value%" contains "kotharena"

#

using loop-value because you're using a list where the value is a player

#

for the on region leave event, the region is name of event-region or just event-region, I forget which. if all else fails, if "%event-region%" contains "text"

limber sable