Enemy Health Won't go Down

I’m following a tutorial on youtube (Unity Tutorial For Beginners - How To Make A Game - Part 011 - Raycast & Enemies - YouTube). They are using unity 5 and I’m using unity 5.6. Our scripts are identical and attached to the same things, but I have the error “NullReferenceException: Object reference not set to an instance of an object
AttackScript.Update () (at Assets/Scripts/AttackScript.js:11)”. This is the script:
var hitpoint : int = 10;
var totarget : float;
var range : float = 5;

function Update () {
if (Input.GetButtonDown(“Attack”)) {
var hit : RaycastHit;
if (Physics.Raycast (transform.position, transform.TransformDirection(Vector3.forward), hit)) {
totarget = hit.distance;
if (totarget < range) {
hit.transform.SendMessage(“DeductPoints”, hitpoints, SendMessageOptions.DontRequireReciever);
}
}
}
}

What did I do wrong?

@Joebear Looks like you declared a variable called hitpoint at the beginning but then reference hitpoints with an s in your sendmessage function.