Why Isn't This Button Function Working?

Hello,

Will someone enlighten me as to why buttPress() rarely works and freaks out most of the time? buttPress2() works perfectly all the time.

It's not a huge deal. I'll use the second function. I'm just curious where I'm going wrong in the first.

const byte midButt = 7; // Middle button pin
const byte lButt = 8; // Left button pin
const byte rButt = 9; // Right button pin
byte buttPress();
void buttPress2();
unsigned long buttTime = 0;  //Debounce Ebutton
unsigned long lastButtTime = 0;  //Debounce Ebutton
byte buttMode = 0;

void setup() {
  // put your setup code here, to run once:
 Serial.begin(9600);
 pinMode(midButt, INPUT_PULLUP);
 pinMode(lButt, INPUT_PULLUP);
 pinMode(rButt, INPUT_PULLUP);
}

void loop() {

///*
if(buttPress()==1){
  Serial.println("1");
}
if(buttPress()==3){
  Serial.println("3");
}
if(buttPress()==2){
  Serial.println("2");
}
//*/


/*
buttPress2();
if(buttMode==1){
 Serial.println("1");
 buttMode=0; 
}
else if(buttMode==2){
 Serial.println("2");
 buttMode=0; 
}
else if(buttMode==3){
 Serial.println("3");
 buttMode=0; 
}
*/

}


byte buttPress(){
      if (digitalRead(midButt) == LOW) {
      buttTime = millis();
      if (buttTime - lastButtTime > 250) {
        lastButtTime = buttTime;
        return 2; 
      }
    }
      else if (digitalRead(lButt) == LOW) {
      buttTime = millis();
      if (buttTime - lastButtTime > 250) { 
        lastButtTime = buttTime;
        return 1;
      }
    }
      else if (digitalRead(rButt) == LOW) {
      buttTime = millis();
      if (buttTime - lastButtTime > 250) {
        lastButtTime = buttTime; 
        return 3;
      }
    }
    else{
      return 0;
      }      
}

void buttPress2(){
      if (digitalRead(midButt) == LOW) {
      buttTime = millis();
      if (buttTime - lastButtTime > 250) {
        lastButtTime = buttTime;
        buttMode=2; 
      }
    }

      else if (digitalRead(lButt) == LOW) {
      buttTime = millis();
      if (buttTime - lastButtTime > 250) { 
        lastButtTime = buttTime;
        buttMode=1;
      }
    }
      else if (digitalRead(rButt) == LOW) {
      buttTime = millis();
      if (buttTime - lastButtTime > 250) {
        lastButtTime = buttTime; 
        buttMode=3;
      }
    }
}

you are not storing the value and that will be erase at every cycle.

Oh, I see. That makes total sense. Thanks!