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

Countdown

Discussion in 'Development' started by LucGamesDE, Mar 22, 2017.

  1. LucGamesDE

    LucGamesDE Baby Zombie

    Messages:
    170
    I created a countdown. But it stops every time at "4".
    PHP:
    public function setCount() {
    $this->load 5;
    $this->load--;
    echo 
    $this->load."\n";
    return 
    $this->load;
    }
     
  2. LilCrispy2o9

    LilCrispy2o9 Spider Jockey

    Messages:
    43
    GitHub:
    lilcrispy2o9
    Evry time you run the function, your $load variable is being set to 5 and the being subtracted by one producing the value of 4. Initialize your $load variable before you run this function instead of doing it inside.

    $this->load = 5;
    $this->setCount();
     
    Jack Noordhuis and Muqsit like this.
  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.