You must add delay with task. If you send form when player join the game without delay, it is not showing up to player. You must use least 1 second delay.
You could send it in First movement and save in a config if it shows and if the Player leaves it would save again in a config
Hello, you should use this in use's (under name space in your Main.php): PHP: use pocketmine\Player; //if you didin't use it befor... its for getting player.use pocketmine\event\player\PlayerJoinEvent; //and its for join eventuse jojoe77777\FormAPI; //its for creating ui forms. so now you need use this code to Create Form : PHP: public function JoinMenuUiForm(Player $player){ $form = $this->getServer()->getPluginManager()->getPlugin("FormAPI")->createSimpleForm(function (Player $player, int $data = null) { if ($data === null) { return; } switch ($data) { case "1": //do some thing stuff break; case "2": //do some thing stuff . break; } }); $form->addTitle("§aHello Player"); $form->setContent("Welcome to BrokenEnchant Server, Please Dont use badwords on server."); $form->addButton("§aOk, Lets Play."); $form->addButton("§cBack"); $form->sendToPlayer($player); return $form;} and then you should use JoinEvent Like this code: PHP: public function GodWeedZao(PlayerJoinEvent $event) { if ($event->getPlayer() instanceof Player) { $this->JoinMenuUiForm($event->getPlayer()); //Every thing is Done! }} Enjoy The Plugin, Lol
oh, sorry i didnt say, befor create plugin you should install FormAPI (by jojoe77777). also dont forget to register events.