store array via serial monitor to eeprom

Can anyone help me, I have done some experiments but still fail. I want to save the integer data from serial monitor to eeprom in the form of array. So far my coding can only save into array aja. So weakness when arduino restart the data input at before array is lost, and value to default.
This is my code

#include <EEPROM.h>

/*
int default_n1 = 450;
int default_n2 = 550;
int default_n3 = 700;
int default_n4 = 850;
*/
int value = 5; //*
int nilai[value]={150,170,190,220,250};   // threshold value

const byte numChars = 32;
char receivedChars[numChars];
boolean newData = false;

const byte buffSize = 40;
char inputBuffer[buffSize];
const char startMarker = '#';
const char endMarker = '\n';
byte bytesRecvd = 0;
boolean readInProgress = false;
boolean newDataFromPC = false;

char messageFromPC[buffSize] = {0};
int newFlashInterval = 0;

unsigned long curMillis;

unsigned long prevReplyToPCmillis = 0;
unsigned long relyToPCinterval = 0;

const int led1 = 2;
const int led2 = 3;
const int led3 = 4;
const int led4 = 5;
const int led5 = 6;

int gas = A0;
/*
 * Normal air returns approximately 100-150
   Alcohol returns approximately 700
   Lighter gas returns approximately 750
 */
void setup() {
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);
  pinMode(led4, OUTPUT);
  pinMode(led5, OUTPUT);
  pinMode(gas, INPUT);

  digitalWrite(led1,HIGH);
  digitalWrite(led2,HIGH);
  digitalWrite(led3,HIGH);
  digitalWrite(led4,HIGH);

  Serial.begin(9600);
  Serial.println("===== System Start =====");
  Serial.print("");
}

void loop() {
readSensor();
getDataFromPC();
replyToPC();
updateFlashInterval();
}  
  
void getDataFromPC() {

    // receive data from PC and save it into inputBuffer
    
  if(Serial.available() > 0) {

    char x = Serial.read();

      // the order of these IF clauses is significant
      
    if (x == endMarker) {
      readInProgress = false;
      newDataFromPC = true;
      inputBuffer[bytesRecvd] = 0;
      parseData();
    }
    
    if(readInProgress) {
      inputBuffer[bytesRecvd] = x;
      bytesRecvd ++;
      if (bytesRecvd == buffSize) {
        bytesRecvd = buffSize - 1;
      }
    }

    if (x == startMarker) { 
      bytesRecvd = 0; 
      readInProgress = true;
    }
  }
}

void parseData() {
    
char * strtokIndx; // this is used by strtok() as an index
  
strtokIndx = strtok(inputBuffer,":");      // get the first part - the string
strcpy(messageFromPC, strtokIndx);         // copy it to messageFromPC
  
strtokIndx = strtok(NULL, ":");            // this continues where the previous call left off
newFlashInterval = atoi(strtokIndx);       // convert this part to an integer
}

void updateFlashInterval() {

   // this illustrates using different inputs to call different functions
  if (strcmp(messageFromPC, "nilai1") == 0) {
     //EEPROM.put(0,nilai[0]);
     update_nilai1();
  }
  if (strcmp(messageFromPC, "nilai2") == 0) {
    // EEPROM.put(1,nilai[1]);
     update_nilai2();
  }
  if (strcmp(messageFromPC, "nilai3") == 0) {
    // EEPROM.put(2,nilai[2]);
     update_nilai3();
  }
  if (strcmp(messageFromPC, "nilai4") == 0) {
     //EEPROM.put(3,nilai[3]);
     update_nilai4();
  }
  if (strcmp(messageFromPC, "nilai5") == 0) {
     //EEPROM.put(4,nilai[4]);
     update_nilai5();
  }
}

//============================================

void update_nilai1() {
  if (newFlashInterval > 100) {
    //EEPROM.get(nilai[0]);
    nilai[0] = newFlashInterval;
    
  }
}

void update_nilai2() {
  if (newFlashInterval > 100) {
    //EEPROM.get(nilai[1]);
    nilai[1] = newFlashInterval;
  }
}

void update_nilai3() {
  if (newFlashInterval > 100) {
    //EEPROM.get(nilai[2]);
    nilai[2] = newFlashInterval;
  }
}

void update_nilai4() {
  if (newFlashInterval > 100) {
    //EEPROM.get(nilai[3]);
    nilai[3] = newFlashInterval;
  }
}

void update_nilai5() {
  if (newFlashInterval > 100) {
    //EEPROM.get(nilai[4]);
    nilai[4] = newFlashInterval;
  }
}

void replyToPC() {
  if (newDataFromPC) {
    newDataFromPC = false;
    Serial.print("Msg: ");
    Serial.println(messageFromPC);
    Serial.print("NewValue: ");
    Serial.println(newFlashInterval);
    }
} 
  
void readSensor(){
  
  int analogSensor = analogRead(gas);
  Serial.print("Nilai Sensor: ");
  Serial.println(analogSensor);

//  if ((analogSensor > default_n1) && (analogSensor < default_n2))   // opsi kedua
    if ((analogSensor > nilai[0]) && (analogSensor < nilai[1]))
    {
    digitalWrite(led1, LOW);}
    else{digitalWrite(led1,HIGH);
    }

   if ((analogSensor > nilai[1]) && (analogSensor < nilai[2])) 
    {
    digitalWrite(led2,LOW);}
    else{digitalWrite(led2,HIGH);
    }

   if ((analogSensor > nilai[2]) && (analogSensor < nilai[3]))
    {
    digitalWrite(led3,LOW);}
    else{digitalWrite(led3,HIGH);
    }

   if ((analogSensor > nilai[3]) && (analogSensor < nilai[4]))
    {
    digitalWrite(led3,LOW);}
    else{digitalWrite(led3,HIGH);
    }
//  if(analogSensor > default_n4)
    if(analogSensor > nilai[4])
    {
    digitalWrite(led4,LOW);}
    else{digitalWrite(led4,HIGH);
    }
delay(1000);
}
int nilai[value] = {150, 170, 190, 220, 250}; // threshold value

nilai is declared as an int

EEPROM.put(0,nilai[0]);

An int is 2 bytes so the data will be stored in EEPROM addresses 0 and 1

EEPROM.put(1,nilai[1]);

An int is 2 bytes so the data will be stored in EEPROM addresses 1 and 2

Can you see a problem ?

Note also that your code could be improved by using a single function to update the array

Thank you very much, I know the problem