Why it does not work? when the player executes "/ cps on" starts the task when you run "/ cps off" it cancels the task Can someone help me please? - Sorry for my bad English PHP: public $cps = false; // MAIN case "cps": if(!isset($args[0])){ if ($sender instanceof Player) { $sender->sendMessage("§e§lUSO: §r§e/cps§7 <on/off>"); } else {$sender->sendMessage("§cUse o comando dentro do jogo!");} } else { if($args[0] == "on"){$this->getScheduler()->scheduleRepeatingTask(new BMsg($this, $sender), 1); $sender->sendMessage("§e§lMOD: §r§eCPS ativado com sucesso!"); $this->cps = true; } elseif ($args[0] == "off"){ $sender->sendMessage("§e§lMOD: §r§eCPS desligado com sucesso!"); $this->cps = false; } } PHP: // TASK public function onRun(int $currentTick) { $cps = $this->plugin->getClicks($this->player); $this->player->sendTip("§eCPS:§7 {$cps}"); if($this->plugin->cps = false){ $this->plugin->getScheduler()->cancelTask($this->getTaskId());}}}