When player close form it execute code that's used for first button :/ Sending form: PHP: $data = []; $data['type'] = 'form'; $data['title'] = $p->getText('ITEM_PARTICLES' , []); $data['content'] = ""; $content = ["text" => "NORMAL PARTICLES"]; $data["buttons"][] = $content; $content = ["text" => "§dCloud Particle §2§l[LVL 8]"]; $data["buttons"][] = $content; $content = ["text" => "§dCrystal Particle §2§l[LVL 13]"]; $data["buttons"][] = $content; $content = ["text" => "§6VIP Particles"]; $data["buttons"][] = $content; $content = ["text" => "§6VIP+ Particles"]; $data["buttons"][] = $content; $pk = new ModalFormRequestPacket(); $pk->formId = 2; $pk->formData = json_encode($data); $p->dataPacket($pk); Handling response: PHP: $result = json_decode($pk->formData, true); $data = $result; var_dump($data); if($data == 1){ if(!is_null($data)){ if($p->hasPermission('netsword.vip') || $p->hasPermission('netsword.vipplus') || DatabaseManager::getPlayer($p->getName())['level'] >= 8){ ParticleManager::activateParticle(45, $p); }else{ $p->sendTranslatedMessage('PARTICLE_CANT', ['VIP']); } } } if($data == 2){ if(!is_null($data)){ if($p->hasPermission('netsword.vip') || $p->hasPermission('netsword.vipplus') || DatabaseManager::getPlayer($p->getName())['level'] >= 13){ ParticleManager::acitvateParticle(46, $p); }else{ $p->getCustomInventory()->show(1); $p->sendTranslatedMessage('PARTICLE_CANT', ['VIP']); } } } So when close window it do PHP: ParticleManager::activateParticle(45, $p); and it have to do only when click first button.