how to move only one object ?

I am building a parachute game. i have a helicopter and a third person character from standard assets
Ethan. third person’s controlling are working done. i apply this moving code to my helicopter

void Update() 
{
 Helicopter = GameObject.Find("mi17"); Helicopter.transform.Translate(0,0,-2); Helicopter.transform.rotation = Quaternion.Euler(0, 0, Mathf.Sin(Time.time * 0.8f) * 10 + 0); 
}

after jumping to land from helicopter, character is moving as helicopter code. i need to stop it
need to stop that moving after landing to ground. help me,

Hi;
usually these kinds of problems can be solved by a bool;

u define a bool like :

public bool IsPlayerInHeli = false;

and set its value to true when the player is in the helicopter;
then in the update method u check and make it to only if this value is true the moving code work for u;

     void Update() 
     {
if ( IsPlayerInHeli == true )
{
      Helicopter = GameObject.Find("mi17"); Helicopter.transform.Translate(0,0,-2); Helicopter.transform.rotation = Quaternion.Euler(0, 0, Mathf.Sin(Time.time * 0.8f) * 10 + 0); 
     }
}

and if player is child of helicopet parent dont forget to null the parent so it dont move with the heli;

Player.transform.parent = null;