GUI trigger Not Working!

Hi I have a game were you walk up to a car and a GUI option pops asking you to press c to enter the car. Could you tell me what is wrong with my code please!

#pragma strict
var levelToLoad : String;
function OnCollisionEnter(col : Collision)
{
 if (col.gameObject.name == "LANCEREVOX")
 {
GUI.Label(new Rect(Screen.width/2 - 75, Screen.height - 100, 150, 30), "Drive to City");
if (Input.GetKeyDown("c")) {
Application.LoadLevel(levelToLoad);
}
}
}

please help!

Here’s my earlier comment as an answer. Please flag it as accepted if it works for you :slight_smile:

#pragma strict
        var levelToLoad : String;
        var collidingWithCar : boolean;
        
        function Update()
        {
        	if (Input.GetKeyDown("c")) 
        	{
        		if(collidingWithCar == true)
        		{
        			Application.LoadLevel(levelToLoad);
        		}
        	}
        }
        
        function OnTriggerEnter(col : Collision)
        {
        	if (col.gameObject.name == "LANCEREVOX")
        	{
        		collidingWithCar = true;
        	}
        }
        
        function OnTriggerExit(col : Collision)
        {
        	if (col.gameObject.name == "LANCEREVOX")
        	{
        		collidingWithCar = false;
        	}
        }
        
        function OnGUI()
        {
        	if(collidingWithCar == true)
        	{
        		GUI.Label(new Rect(Screen.width/2 - 75, Screen.height - 100, 150, 30), "Drive to City");
        	}
        }

var levelToLoad : String;
private var enter : boolean;
//Main function
function Update ()
{

if(Input.GetKeyDown("c") && enter){
Application.LoadLevel(levelToLoad);
}
}


function OnGUI(){
if(enter){
GUI.Label(new Rect(Screen.width/2 - 75, Screen.height - 100, 150, 30), "Press 'c' to open the door");
}
}

//Activate the Main function when player is near the door
function OnTriggerEnter (other : Collider){
if (other.gameObject.tag == "Player") {
enter = true;
}
}

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

I know its daft but i had some old code i forgot about, so i modified it and tested it out and it works so thanks any way for trying