Why wont this work? (I've done similar 1000 times fine)

I’ve done this get component stuff 1000 times and its worked just fine, but its been a while so I don’t remember if this is right. I would like it to work without making a public variable for the player but that wasn’t working either. I am trying to access the player’s script NPCDropper when the health equals Zero. and set the boolean to true.

public class EnemyHealth : MonoBehaviour {

    public int curHP;
    public int maxHP;
    public GameObject player;

	void Start () 
    {
        curHP = maxHP;
	}

	void Update () 
    {
        if(curHP <= 0)
        {
            var npcD = player.GetComponent<NPCDropper>();
            npcD.weShouldDrop = true;
        }
	}
}

You are mixing unityscript and C. you are using var to declare a variable.

public int curHP;
    public int maxHP;
    public GameObject player;
 
    void Start () 
    {
        curHP = maxHP;
    }
 
    void Update () 
    {
        if(curHP <= 0)
        {
            NPCDropper npcD = player.GetComponent<NPCDropper>();
            npcD.weShouldDrop = true;
        }
    }
}