1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Create a countdown

Discussion in 'Plugin Help' started by kristian, May 25, 2019.

  1. kristian

    kristian Spider

    Messages:
    10
    Hi, I need to create a countdown I have started this but its not work.

    ----
    $this->getServer()->getScheduler()->scheduleDelayedTask(new class($this) extends PluginTask{
    public function onRun(int $currentTick){
    }
    }, 20 * 10);
    ----
     
  2. HeyDeniis_

    HeyDeniis_ Baby Zombie

    Messages:
    137
    PHP:
    Server::getInstance()->getScheduler()->scheduleDelayedTask(new class($this10) extends Task{
                       
                        public function 
    __construct($pl$time){
                            
    $this->pl $pl;
                            
    $this->time $time;
                        }
                       
                        public function 
    onRun($timer){
                
    $time $this->time--;
    //$time
                        
    }
                    }, 
    4);
     
  3. kristian

    kristian Spider

    Messages:
    10
    Thank you, i set this in a new file.php?
     
  4. HeyDeniis_

    HeyDeniis_ Baby Zombie

    Messages:
    137
    not, insert the Main Class
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.