Servo example works, but mine (wireless) doesn't

Hi, I am trying to control a servo wireless with the help of a bluetooth module. I am quite sure that my servo is not ruined because the sweep sketch does work (and also a sketch I made to make it go to 60,90,120,90 degrees). Here is my sketch:

#include <Servo.h>
Servo myservo;//name my servo
char val;  //variable to store input value from bluetooth module
int bt = 2;  //pin that is feeding the bluetooth module
void setup() {
  // put your setup code here, to run once:
pinMode(bt,OUTPUT);  //set bt pin as output...
digitalWrite(bt,HIGH);    //and put it high.
Serial.begin(9600);   //begin serial communication
myservo.attach(6);  //attach the servo to pin 6
delay(2000);   //wait for servo to reach position
myservo.write(90);  //put servo in center(0_90_180) position
delay(2000);   //wait for servo to reach position
}

void loop() {
  // put your main code here, to run repeatedly:

while(Serial.available()>0)   //while serial connection with bluetooth is available...
{
val = Serial.read();   //assign the serial input to val...
Serial.println(val);   //and print the val to the serial monitor.
}
  if(val == 'r'){   //if val is r (which means right)...
    myservo.write(120);  //put the servo to 120 degrees.
    delay(1200);   //wait for servo to reach position
    val='n';   //put val to 'n' to prevent this block from repeating
  }
  
  else if(val == 'l'){   //if val is 'l' (left)...
    myservo.write(60);   //set servo to 60 degrees.
    delay(1200);   //wait for servo to reach position
    val='n';   //put val to 'n' to prevent this block from repeating
  }
  
  else if(val == 'c');{    //if val is 'c' (center)...
    myservo.write(90);    // set servo to 90 degrees.
    delay(1200);   //wait for servo to reach position
    val='n';   //put val to 'n' to prevent this block from repeating
  }
}
[/code][code]
#include <Servo.h>
Servo myservo;//name my servo
char val;  //variable to store input value from bluetooth module
int bt = 2;  //pin that is feeding the bluetooth module
void setup() {
  // put your setup code here, to run once:
pinMode(bt,OUTPUT);  //set bt pin as output...
digitalWrite(bt,HIGH);    //and put it high.
Serial.begin(9600);   //begin serial communication
myservo.attach(6);  //attach the servo to pin 6
delay(2000);   //wait for servo to reach position
myservo.write(90);  //put servo in center(0_90_180) position
delay(2000);   //wait for servo to reach position
}

void loop() {
  // put your main code here, to run repeatedly:

while(Serial.available()>0)   //while serial connection with bluetooth is available...
{
val = Serial.read();   //assign the serial input to val...
Serial.println(val);   //and print the val to the serial monitor.
}
  if(val == 'r'){   //if val is r (which means right)...
    myservo.write(120);  //put the servo to 120 degrees.
    delay(1200);   //wait for servo to reach position
    val='n';   //put val to 'n' to prevent this block from repeating
  }
  
  else if(val == 'l'){   //if val is 'l' (left)...
    myservo.write(60);   //set servo to 60 degrees.
    delay(1200);   //wait for servo to reach position
    val='n';   //put val to 'n' to prevent this block from repeating
  }
  
  else if(val == 'c');{    //if val is 'c' (center)...
    myservo.write(90);    // set servo to 90 degrees.
    delay(1200);   //wait for servo to reach position
    val='n';   //put val to 'n' to prevent this block from repeating
  }
}
[/code][code]
#include <Servo.h>
Servo myservo;//name my servo
char val;  //variable to store input value from bluetooth module
int bt = 2;  //pin that is feeding the bluetooth module
void setup() {
  // put your setup code here, to run once:
pinMode(bt,OUTPUT);  //set bt pin as output...
digitalWrite(bt,HIGH);    //and put it high.
Serial.begin(9600);   //begin serial communication
myservo.attach(6);  //attach the servo to pin 6
delay(2000);   //wait for servo to reach position
myservo.write(90);  //put servo in center(0_90_180) position
delay(2000);   //wait for servo to reach position
}

void loop() {
  // put your main code here, to run repeatedly:

while(Serial.available()>0)   //while serial connection with bluetooth is available...
{
val = Serial.read();   //assign the serial input to val...
Serial.println(val);   //and print the val to the serial monitor.
}
  if(val == 'r'){   //if val is r (which means right)...
    myservo.write(120);  //put the servo to 120 degrees.
    delay(1200);   //wait for servo to reach position
    val='n';   //put val to 'n' to prevent this block from repeating
  }
  
  else if(val == 'l'){   //if val is 'l' (left)...
    myservo.write(60);   //set servo to 60 degrees.
    delay(1200);   //wait for servo to reach position
    val='n';   //put val to 'n' to prevent this block from repeating
  }
  
  else if(val == 'c');{    //if val is 'c' (center)...
    myservo.write(90);    // set servo to 90 degrees.
    delay(1200);   //wait for servo to reach position
    val='n';   //put val to 'n' to prevent this block from repeating
  }
}

The "val" does get printed to serial monitor correctly. (r for right, l for left) but nothing happens with the servo.(The servo does go to 90 degrees when the arduino is turned on),
I'd greatly appreciate some help.

Oops

I'd lose the "while" loop.
Any non-command characters will overwrite "val".
I'd also lose the delays.

Why so many copies of the code?

Should I use if instead of while? Which delays do you mean? About the copies of code, I'm sorry. I held the ctrl-V buttons to long I guess. Is there a way to fix it or is it too late?

I don't know why you'd use a while in this situation.
An if would be simpler.

By "delays", I mean all the calls to the delay() function.

You didn't mention the excess semicolon I highlighted.

Oh, yes I see that semicolon now. I got it off of my sketch now and I will try it out in a minute. But I have a question: Is it necessary to us a delay() after myservo.write(60);?
About the while loop, I had just always done it that way.

Using long delays is almost never necessary, nor desirable.

This is the code now. Sadly, it still doesn't work.

#include <Servo.h>
Servo myservo;//name my servo
char val;  //variable to store input value from bluetooth module
int bt = 2;  //pin that is feeding the bluetooth module
void setup() {
  // put your setup code here, to run once:
pinMode(bt,OUTPUT);  //set bt pin as output...
digitalWrite(bt,HIGH);    //and put it high.
Serial.begin(9600);   //begin serial communication
myservo.attach(6);  //attach the servo to pin 6
delay(500);   //wait for servo to reach position
myservo.write(90);  //put servo in center(0_90_180) position
delay(500);   //wait for servo to reach position
}

void loop() {
  // put your main code here, to run repeatedly:

if(Serial.available()>0)   //while serial connection with bluetooth is available...
{
val = Serial.read();   //assign the serial input to val...
Serial.println(val);   //and print the val to the serial monitor.
}
  if(val == 'r'){   //if val is r (which means right)...
    myservo.write(120);  //put the servo to 120 degrees.
    delay(1000);   //wait for servo to reach position
    val='n';   //put val to 'n' to prevent this block from repeating
  }
  
  else if(val == 'l'){   //if val is 'l' (left)...
    myservo.write(60);   //set servo to 60 degrees.
    delay(1000);   //wait for servo to reach position
    val='n';   //put val to 'n' to prevent this block from repeating
  }
  
  else if(val == 'c'){    //if val is 'c' (center)...
    myservo.write(90);    // set servo to 90 degrees.
    delay(1000);   //wait for servo to reach position
    val='n';   //put val to 'n' to prevent this block from repeating
  }
}

I got in to the datasheet of my servo (Towar dpro MG 996R), and found this "Operating speed: 0.17 s/60, which means my delays could be only 90 milliseconds

Hi, Semperldem, I am sorry I took your time. I am finding now that I had connected the PWM pin of the servo to pin 5 instead of pin 6. Thanks for your help. I did learn some good things. God bless you and have a good evening!