the timer is for some reason going down by 5 seconds each 1 second... Task: PHP: public function onRun(int $currentTick) { foreach (Server::getInstance()->getOnlinePlayers() as $players) { $timer = $this->listener->getTimer(); if ($timer > 0) { $timer--; $this->listener->setTimer($timer); $players->sendPopup("§r§6Current Event:§r§e Blood Bath"); $this->listener->updateScoreboard(); } else { if (!$players instanceof HestraPlayer) return false; $this->listener->setClaimable(true); $this->plugin->getScheduler()->cancelTask($this->getTaskId()); $this->plugin->getServer()->broadcastMessage(Main::PREFIX . " The Blood Bath event has ended!"); $players->updateScoreboard(); } } } how i started it: PHP: $this->plugin->getScheduler()->scheduleRepeatingTask(new BloodBathTask($this->plugin, $this), 20);
without the full code i can only go with blind shot in the dark but I think you deducted the timer based on the amount of the players online so say if there's only 1 player you would get it act normally if there's 10 players the timer would skip forward 10 times wont be spoon feeding you this but should be easy to find where that error lies now that i have given clues