Why won't my character flip?

In my game my character is supposed to flip but he won’t heres the code any mistakes?

using UnityEngine;
using System.Collections;

public class flip : MonoBehaviour {

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {
	Vector3 theScale = transform.localScale;

	if (Input.GetKey (KeyCode.LeftArrow)) {
		theScale.x *= -1;
	}
	else if (Input.GetKey (KeyCode.RightArrow)) {
		theScale.x *= 1;
	}
}

}

if (Input.GetKey (KeyCode.LeftArrow)) {
theScale.x = -1;
}
else if (Input.GetKey (KeyCode.RightArrow)) {
theScale.x = 1;
}

When the x value of the object goes to negative you need to multiply with - to get it positive

// Use this for initialization
void Start () {

    	}
    	
    	// Update is called once per frame
    	void Update () {
    		Vector3 theScale = transform.localScale;
    		if (Input.GetKey (KeyCode.LeftArrow)) {
    			theScale.x = -0.3f;
    		}
    		else if (Input.GetKey (KeyCode.RightArrow)) {
    			theScale.x = 0.3f;
transform.localScale = theScale;
    		}
    
    	}