HELP exit status 1 expected unqualified-id before 'for'

here is my code, it gives me a error and i can’t find how to solve it
#include <LiquidCrystal_I2C.h>
#include <Wire.h>

#include <DHT.h>

#define DHTPIN 2
#define DHTTYPE DHT11
//#define LiquidCrystal_I2C

LiquidCrystal_I2C lcd = LiquidCrystal_I2C(0x27,16,2);
DHT dht(DHTPIN, DHTTYPE);

int GREEN = 8;
int AMBER = 9;
int RED = 10;

void setup() {

Serial.begin(9600);
dht.begin();
pinMode (GREEN, OUTPUT);
pinMode (AMBER, OUTPUT);
pinMode (RED, OUTPUT);

dht.begin();
lcd.begin(16, 2);

Wire.begin();
Serial.begin(9600);
while (!Serial);
Serial.println("\nI2C Scanner");
}
void loop() {
byte error, address;
int nDevices;
Serial.println(“Scanning…”);
nDevices = 0;}
for (address = 1; address < 127; address++ ) /The error is here ← /
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0) {
Serial.print(“I2C device found at address 0x”);}
if (address < 16){
Serial.print(“0”);
Serial.print(address, HEX);
Serial.println(" !");
nDevices++;
}
else if (error == 4) {
Serial.print(“Unknown error at address 0x”);}
if (address < 16){
Serial.print(“0”);
Serial.println(address, HEX);
}
}
if (nDevices == 0)
Serial.println(“No I2C devices found\n”);
else
Serial.println(“done\n”);
delay(5000);
}

if (t <= 20) {
digitalWrite (GREEN, HIGH);
digitalWrite (AMBER, LOW);
digitalWrite (RED, LOW);
}

else if (t <= 30) {
digitalWrite (GREEN, LOW);
digitalWrite (AMBER, HIGH);
digitalWrite (RED, LOW);
}
else {
digitalWrite (GREEN, LOW);
digitalWrite (AMBER, LOW);
digitalWrite (RED, HIGH);
}

}

The problem is that you finished loop() with a } just before that error line. So it and everything following are not inside any function and having code outside a function is not allowed.

Try using Ctrl-T (Auto Format) and check that your braces {} are paired correctly.

Steve