How would i make it transform player.position =target.position?

#pragma strict

var buttonInRange;
var buttonActivated;
var doorSound : AudioClip;
var target : Transform;


function OnTriggerEnter(c : Collider)
{
   buttonInRange =true;

}
function OnTriggerExit (c : Collider)
{
buttonInRange = false;
}
function Update () 
{
if(buttonInRange == true)
{
 if(Input.GetKeyDown("e")) 
 {
        player.transform.position = target.position;
    }
}
}

I’m not sure I understand your question. You already have code that will set this object’s position to the target’s position when the ‘e’ key is pressed.

The thing you’re missing is that you never assign a value to “player”. So make it a public variable at the top of your script and then drag a reference to the player into that slot in the inspector:

var player : GameObject;