Title explains most of it. I read through the code of PocketMine despite this I still can't understand how the function and a event are used. If anyone could explain it would be much appreciated.
So you need to make the timer start on the event? We'll instead of putting the time schedule in the init put it after the case "player.join" or whatever you are using and it will start timer when the event happens
PHP: $this->api->schedule(20 * 60 * $this->interval, array($this, "msg"), array(), false); that's the code the only thing you will need to change is the numbers idk exactly what to put them for seconds or minutes though
they are measured in ticks, 20 ticks = 1 second (If your server is running smooth) that's why it's mostly 20*$interval so you can set the interval in seconds
Put in the quotes whatever function you want to use it in. Since it's "msg" it would be called in PHP: Public function msg(){}