Mixing together 2 scripts?

How can I make thees 2 scripts into one?

#pragma strict
 
public var floatSpeed = .5;
 
 
function Update() {
  if (Physics.Raycast (transform.position, Vector3.down, 5.0)) {
 
            rigidbody.transform.position += Vector3.up * floatSpeed * Time.deltaTime;
            rigidbody.drag = 20.0;
        }
    else{
    rigidbody.drag = 1.0;
    }
 
}




static var selectedId : int;
static var speed : int = 90;
 
function Update (){
    if (selectedId==GetInstanceID()) {
       if (Input.GetKey (KeyCode.UpArrow)) transform.Translate (Vector3(0,0,1) * Time.deltaTime*speed);
       if (Input.GetKey (KeyCode.DownArrow)) transform.Translate (Vector3(0,0,-1) * Time.deltaTime*speed);
       if (Input.GetKey (KeyCode.Space)) transform.Translate (Vector3(0,1,0) * Time.deltaTime*speed);
       if (Input.GetKey (KeyCode.LeftControl)) transform.Translate (Vector3(0,-1,0) * Time.deltaTime*speed);
        if (Input.GetKey(KeyCode.RightArrow))
    transform.Rotate(Vector3.up * speed * Time.deltaTime);
 
 if (Input.GetKey(KeyCode.LeftArrow))
    transform.Rotate(-Vector3.up * speed * Time.deltaTime);
 
}
    }
function OnMouseDown () {
    selectedId = GetInstanceID();
}

If your ‘Mix together’ is really all you want, then there’s nothing more easy.

#pragma strict
 
public var floatSpeed = .5;

static var selectedId : int;
static var speed : int = 90;
 
function Update() {
  if (Physics.Raycast (transform.position, Vector3.down, 5.0)) {
 
            rigidbody.transform.position += Vector3.up * floatSpeed * Time.deltaTime;
            rigidbody.drag = 20.0;
  }
  else{
    rigidbody.drag = 1.0;
  }
 
  if (selectedId == GetInstanceID()) {
       if (Input.GetKey (KeyCode.UpArrow)) transform.Translate (Vector3(0,0,1) * Time.deltaTime*speed);
       if (Input.GetKey (KeyCode.DownArrow)) transform.Translate (Vector3(0,0,-1) * Time.deltaTime*speed);
       if (Input.GetKey (KeyCode.Space)) transform.Translate (Vector3(0,1,0) * Time.deltaTime*speed);
       if (Input.GetKey (KeyCode.LeftControl)) transform.Translate (Vector3(0,-1,0) * Time.deltaTime*speed);
       if (Input.GetKey(KeyCode.RightArrow)) transform.Rotate(Vector3.up * speed * Time.deltaTime);
 
 if (Input.GetKey(KeyCode.LeftArrow))
    transform.Rotate(-Vector3.up * speed * Time.deltaTime);
 }
}

function OnMouseDown () {
    selectedId = GetInstanceID();
}

That really is all there is to it, then…