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_ Silverfish

    Messages:
    24
    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_ Silverfish

    Messages:
    24
    not, insert the Main Class
     

Share This Page

  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.