error message please help me [solved]

I made a code and I thought it would work but i got the error

Zonnepanelen_Programma:79: error: expected unqualified-id before ‘if’
The code i used is

#include <Servo.h>
int light_sensitivity = 500;    //This is the approx value of light surrounding your LDR
int LDR = 0;     //analog pin to which LDR is connected, here we set it to 0 so it means A0
int LDRValue = 0;      //that’s a variable to store LDR values


 Servo motorA;
 int val;

 void setup()
 {
 motorA.attach(12);
 }
 
 void loop()

  {{{

    LDRValue = analogRead(LDR);      //reads the ldr’s value through LDR 

    Serial.println(LDRValue);       //prints the LDR values to serial monitor

    delay(50);        //This is the speed by which LDR sends value to arduino

 

    if (LDRValue > light_sensitivity) 

      {
        {motorA.detach();
  
        }}else
       motorA.attach(12);
        motorA.write(10);
        delay(1000); 
      
       if (LDRValue > light_sensitivity) 

      {
        {motorA.detach();
        
        }}else 
        motorA.attach(12);
        motorA.write(20);
        delay(1000);
        
      
      if (LDRValue > light_sensitivity) 

      {{motorA.detach();
        
        
      }}else 
        motorA.attach(12);
        motorA.write(30);
        delay(1000);
      }
       if (LDRValue > light_sensitivity) 

      {{motorA.detach();
       
  }}else 
         motorA.attach(12);
        motorA.write(40);
        delay(1000);
        
      }
       if (LDRValue > light_sensitivity) 

      {{motorA.detach();
        
  }}else 
  motorA.attach(12);
        motorA.write(50);
        delay(1000);
        
        
      }
       if (LDRValue > light_sensitivity) 

      {{motorA.detach();
        
  }else 
  motorA.attach(12);
        motorA.write(60);
        delay(1000);
        
        
      }
       if (LDRValue > light_sensitivity) 

      {{motorA.detach();
        
  }else 
  motorA.attach(12);
        motorA.write(70);
        delay(1000);
        
        
      }
       if (LDRValue > light_sensitivity) 

      {{motorA.detach();
       
  }else 
   motorA.attach(12);
        motorA.write(80);
        delay(1000);
        
        
      }
       if (LDRValue > light_sensitivity) 

      {{motorA.detach();
        
  }else 
  motorA.attach(12);
        motorA.write(90);
        delay(1000);
        
        
      }
       if (LDRValue > light_sensitivity) 
       {motorA.detach();

      {
        
  }else 
  motorA.attach(12);
        motorA.write(100);
        delay(1000);
        
        
      }
       if (LDRValue > light_sensitivity) 
         {motorA.detach();
      {
        
  }else 
  motorA.attach(12);
        motorA.write(110);
        delay(1000);
       
        
      }
       if (LDRValue > light_sensitivity) 
        {motorA.detach();
      {
        
  }else 
  motorA.attach(12);
        motorA.write(120);
        delay(1000);
        
        
      }
       if (LDRValue > light_sensitivity) 

      {{motorA.detach()
        
  }else 
        ;motorA.attach(12);
        motorA.write(130);
        delay(1000);
        
      }
       if (LDRValue > light_sensitivity) 

      {{motorA.detach()
        
  }else 
        ;motorA.attach(12);
        motorA.write(140);
        delay(1000);
        
      }
       if (LDRValue > light_sensitivity) 

      {{motorA.detach();
       
  }else 
         motorA.attach(12);
        motorA.write(150);
        delay(1000);
        
      }
       if (LDRValue > light_sensitivity) 
      

      {{motorA.detach();
       
  }else 
         motorA.attach(12);
        motorA.write(160);
        delay(1000);
        
      }
       if (LDRValue > light_sensitivity) 

      {{motorA.detach();
       
  }else 
         motorA.attach(12);
        motorA.write(170);
        delay(1000);
        
      }
       if (LDRValue > light_sensitivity) 

      {{motorA.detach();
        
  
        
      }
      
        else 
        motorA.attach(12);
        motorA.write(180);
        delay(1000);
        
        
       
        } 
      }

Can somebody help me?

That's some eccentric code formatting you've got there.

AWOL: That's some eccentric code formatting you've got there.

I was trying to make a shadow seeking servo

You can't have executable code that isn't in a function.

AWOL: You can't have executable code that isn't in a function.

but everyting worked until i swapped every motorA.detach(); with motorA.attach(12); motorA.write(60); delay(1000);

So, go back to that code. If it worked, why did you change it?

AWOL: So, go back to that code. If it worked, why did you change it?

it didn't work as i wanted it to work. it didn't stop when there was a shadow.

What is going on with all this attaching and detaching motors?

aarg: What is going on with all this attaching and detaching motors?

making it stop moving when the ldr sees a shadow

It looks to me like the block with the "write(60)" is not inside the loop() function. That isn't allowed.

Sort out your {} braces, and you should see the problem.

AWOL: It looks to me like the block with the "write(60)" is not inside the loop() function. That isn't allowed.

Sort out your {} braces, and you should see the problem.

That was indeed the problem i got the program to work now