Hi, I'm new to using forms and PMMP development in general, I'd just like to know, how do I direct a button to another form using SimpleForm. In this case, how do I direct the "test" button to another UI, so when you click the button it sends you to another UI that I can edit. Code: $api = $this->getServer()->getPluginManager()->getPlugin("FormAPI"); $form = $api->createSimpleForm(function (Player $player, int $data = null){ $result = $data; if ($result === null) { return; } if($result === 0) { } switch ($result) { case 0: break; } return; } ); $form->setTitle("Title"); $form->setContent("yay content"); $form->addButton("test"); $form->sendToPlayer($player);
Just create another form inside PHP: if($result === 0) {$newform = $api->createSimpleForm(function (Player $player, int $data = null){});//...$player->sendForm($newform);}