Arduino Uno.
Help is very much appreciated.
Put this into a case:
This is what I had when first writing the script which I dont even think would have worked and anyway is now uncompatible to do this action:you get the idea though of what I was trying to do

buttonPin2State = digitalRead(buttonPin2);
if((buttonPin2State== HIGH) && (digitalRead(ledPin3) == HIGH)) {
for (count=0;count<5;count++ ) {
digitalWrite(pinArray[count], HIGH);
delay(timer*2);
digitalWrite(pinArray[count], LOW);
delay(timer);
}
}
else if ((buttonPin2State == HIGH) && (digitalRead(ledPin5) == HIGH)) {
for (count=0;count<5;count++) {
digitalWrite(pinArray[count], HIGH);
delay(timer);
digitalWrite(pinArray[count], LOW);
delay(500);
}
}
else if((buttonPin2State== HIGH) && (digitalRead(ledPin6) == HIGH)) {
for (count=0;count<5;count++) {
digitalWrite(pinArray[count], HIGH);
delay(400);
digitalWrite(pinArray[count], LOW);
delay(200);
}}}