PHP: $level = $this->getServer()->getLevelByName("/*SkyWars world name*/");$positions = array( ($xOne, $yOne, $zOne, $level), ($xTwo, $yTwo, $zTwo, $level), ($xThree, $yThree, $zThree, $level), ($xFour, $yFour, $zFour, $level));foreach($players as $player){ $player->teleport(new Position(array_rand($postions, 1)));} But that would be randomly and maybe two players at one position
Your code syntax is incorrect. PHP doesn't use the tuple syntax from Python. Also, that is not how array_rand is used. array_rand returns the key for the value in an array, not the actual value itself. @PaulchenHD I've corrected most of the errors, but some might linger: PHP: $level = $this->getServer()->getLevelByName("name here"); //Get the level by its name$positions = [ [1, 2, 3], [4, 5, 6], [7, 8, 9], [1, 2, 3], [4, 5, 6], [7, 8, 9], [1, 2, 3], [4, 5, 6] //These can be any numbers, integers are just to show, format: [x, y, z], assuming everyone will be in the same level];$count = 0;foreach($players as $player){ //Assuming $players returns an array of players if($count++ > 8){ //Only eight players, if $count is greater than eight, we can stop teleporting players break; } $v = $positions[$count]; $player->teleport(new Position($v[0], $v[1], $v[2], $level));} array() is the same as [], but I would recommend using the latter when you're initializing an array, it's shorter. But that's just a matter of coding style. And also, the user who created this thread was not asking how to teleport players to random positions.