Why do i get : 'sensorValue' was not declared in this scope. ?

Because you have not told the compiler what type sensorValue is. You need to put the type e.g. int or byte etc. in front of it the first time it is mentioned. Change your line to:

int sensorValue = analogRead (sensorPin);

Steve