elevator with buttons

hello i am trying to script an elevator i want it to move to the second floor when i press the f button and to the third floor if i press the g button.
I made a platform i made a first floor gameobject and a third and second floor gameobject
but the problem with my script is that when i press the f button it goes to the second floor but when i add the g button scrip the f button bugs and to unbug it the g button has to be pressed so that the f button works i don’t know what to do as i said i want it to go to the second floor when i press f and i want it to go to the third floor when i press g .
this is my scrip

var smooth = 2.0;
var DestinationSpot:Transform;
var OriginSpot:Transform;
var up : boolean;
var down : boolean;
//Main function
function Update ( ){
 if(transform.position == DestinationSpot.position)
	{
		Switch = true;
	}
	if(transform.position == OriginSpot.position)
	{
		Switch = false;
	}
if(up == true){
transform.position = Vector3.MoveTowards(transform.position, DestinationSpot.position, smooth);
// Dampen towards the target rotation
transform.position = Vector4.MoveTowards(transform.position, OriginSpot.position,
Time.deltaTime * smooth);
}
 
if(up == false){
transform.position = Vector3.MoveTowards(transform.position, OriginSpot.position, smooth);
// Dampen towards the target rotation
transform.position = Vector4.MoveTowards(transform.position, DestinationSpot.position,
Time.deltaTime * smooth);
}
 
if(down == true){
if(Input.GetKeyDown("f")){
up = !up;
}
}
 
}
 
//Activate the Main function when player is near the door
function OnTriggerEnter (other : Collider){

if (other.gameObject.tag == "Player") {
(down) = true;
}
}
 
//Deactivate the Main function when player is go away from door
function OnTriggerExit (other : Collider){
 
if (other.gameObject.tag == "Player") {
(down) = false;
}
}
this was the first scrip this is the second
var smooth = 2.0;
var ThirdSpot:Transform;
var OriginsSpot:Transform;
var left : boolean;
var right : boolean;
var //Main function
function Update ( ){
 if(transform.position == ThirdSpot.position)
	{
		Switch = true;
	}
	if(transform.position == OriginsSpot.position)
	{
		Switch = false;
	}
if(left == true){
transform.position = Vector3.MoveTowards(transform.position, ThirdSpot.position, smooth);
// Dampen towards the target rotation
transform.position = Vector4.MoveTowards(transform.position, OriginsSpot.position,
Time.deltaTime * smooth);
}
 
if(left == false){
transform.position = Vector3.MoveTowards(transform.position, OriginsSpot.position, smooth);
// Dampen towards the target rotation
transform.position = Vector4.MoveTowards(transform.position, ThirdSpot.position,
Time.deltaTime * smooth);
}
 
if(right == true){
if(Input.GetKeyDown("g")){
left = !left;
}
}
 
}
 
//Activate the Main function when player is near the door
function OnTriggerEnter (other : Collider){

if (other.gameObject.tag == "Player") {
(right) = true;
}
}
 
//Deactivate the Main function when player is go away from door
function OnTriggerExit (other : Collider){

if (other.gameObject.tag == "Player") {
(right) = false;
}
}

i placed them in two different javascript files after that i placed them into the same cube which is the elevator

never mind i got it to work