Hello how can I create a timer so seen in a minecraft plugin that delays happening $sender->sendMessage ("Hi"); 2 seconds later $sender->sendMessage("Hi 2"); So how is that possible?
Sorry I still do not kapire can someone scream the code so that after 2 seconds ... so a 2 second interval?
That is the funniest thing I've seen all day, "kapieren" does not translate to English that way, use "understand" instead. Here's the code using a ClosureTask: PHP: $sender->sendMessage("Hi");$seconds = 2;$this->getScheduler()->scheduleDelayedTask(new \pocketmine\scheduler\ClosureTask( function(int $currentTick) use ($sender): void { $sender->sendMessage("Hi 2"); }), 20 * $seconds);