Error message - a function-definition is not allowed here before '{' token

Read previous messages on this matter a still can't see why.

// PROJECT 3 Interactive Traffic Light
int carRed = 12; //configure traffic light
int carYellow = 11;
int carGreen = 10;
int button = 9; //pin of button
int pedRed = 8; //configure light for pedestrians
int pedGreen = 7;
int crossTime = 5000; //time for pedestrians to pass unsigned
long changeTime; //time that the button is pressed

void setup() {
//configure all LEDs as output
pinMode(carRed, OUTPUT);
pinMode(carYellow, OUTPUT);
pinMode(carGreen, OUTPUT);
pinMode(pedRed, OUTPUT);
pinMode(pedGreen, OUTPUT);
pinMode(button, INPUT); //configure button as input
digitalWrite(carGreen, HIGH); //initialize green traffic light on digitalWrite(pedRed, LOW); //initialize red pedestrian light off }

void loop() {
int state = digitalRead(button);
// test if the button is pressed and if 5 seconds have passed after it is pressed lately.
if(state == HIGH && (millis() - changeTime)> 5000){
//carry out the function of changing LED
changeLights();
}
}
void changeLights(){

This whole line is a comment so an important part of your code is missing...

 //initialize red pedestrian light off }

This function definition is incomplete...

 void changeLights(){

These are forum code tags. Please use them...
[​code]// put you code here when posting[​/code]
You can insert them with the </> button or by using the “copy code for forum” feature in the Arduino IDE.

change this line:

//initialize red pedestrian light off }

TO

//initialize red pedestrian light off 
}

Thanks for that, I'm still a fair way off competency

For button, it is better to use pull-up/pull-down resistor.