How do i get how many players there are in Multiple worlds and add them so when i add it to a form it will show the player count of 2 worlds
PHP: $playerCount = 0;$worlds = ["world1", "world2"]; // Add which worlds will calculateforeach($worlds as $world){ if(!Server::getInstance()->isLevelLoaded($world)){ Server::getInstance()->loadLevel($world); } $level = Server::getInstance()->getLevelByName($world); $playerCount += count($level->getPlayers());}// Do what do you want with $playerCount