countdown is ready but i like to have a code if the countdown 0 : if($seconds == 0) { and i like to have this: all players from the "world1" teleport to "world2" and all players from "world2" teleport to "world3" and all players from "world3" teleport to "world1" please help me
yeah i have it but i dont know how to set all world1->world2 world2->world3 world3->world1 do you know what i mean ?
Let's call the players in worlds 1, 2 and 3 A, B and C. PHP: // Level $world1, $world2, $world3;$A = $world1->getPlayers();// now:// world 1: A// world 2: B// world 3: Cforeach($world3->getPlayers() as $player){ $player->teleport($world1->getSpawnLocation());}// now:// world 1: A, C// world 2: B// world 3: (empty)foreach($world2->getPlayers() as $player){ $player->teleport($world3->getSpawnLocation());}// now:// world 1: A, C// world 2: (empty)// world 3: Bforeach($A as $player){ $player->teleport($world2->getSpawnLocation());}// now:// world 1: C// world 2: A// world 3: B
i have this: PHP: if($seconds == 0) { foreach($this->getServer()->getLevelByName("world1")->getPlayers() as $player) { $player->teleport($this->getOwner()->getServer()->getLevelByName("world2")->getSafeSpawn()); } and how tp the players from world2->world3 and world3->world1
Cache $world1, $world2 and $world3 if you want to prevent overhead of searching for a Level object with that name every time.