Parse integer from serial data if recieved

Having a bit of trouble parsing the information I have received over a bluetooth connection, when a integer is between the values of 7 & 29 I wish to store this information and use it later on in my code however when I print out int x over serial it does not display the number I sent over bluetooth only the number 0.
Any help?

int ledPin = 13;
int x;
String readString;
String str;

void setup() {
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT); 
  Serial.println("Starting Up!"); 
}

void loop() {

  while (Serial.available()) {
    delay(3);  
    char c = Serial.read();
    readString += c; 
  }

  if (readString.length() >0) {
    Serial.println(readString);

    if (readString == "GET:")     //When "GET" is received over serial, turn led light on. - WORKS.
    {
      digitalWrite(ledPin, HIGH);
    }
    
    if (str = Serial.readStringUntil ('\n'));
      x = Serial.parseInt();
    {
      digitalWrite(ledPin, LOW);
      Serial.println(x);
    }

    readString="";
  } 
}

Please edit your message to put the code in code tags, not quote tags.

Having a bit of trouble parsing the information I have received over a bluetooth connection, when a integer is between the values of 7 & 29

Why do you need to piss away resources on the String class to get such a small number of characters?

    delay(3);

Stupid as a box of rocks. That is NOT the way to "assure that there is data to read"!

    if (str = Serial.readStringUntil ('\n'));

Why is this an if statement?

You clearly haven't a clue about reading serial data. You need to dump all that code and start here:
https://forum.arduino.cc/index.php?topic=288234.0

Managed to read around and complete what I wanted to do and PaulS don't worry I didn't waste the resources on the string class once I figured out the correct and most efficient way to do it.