FPSTutorial: AI robot not taking any damage

Hi! This is a followup to the last question. I have used all of the official tutorial resources and PDF document. But, I just cant get the robot to take any damage! It will first run in place the other way from me, then when I shoot it, it doesn’t die! I’ve tried to add a box collider and numerous things, but it just doesn’t do a darn thing! Thank you!
Oh yeah, here’s my script:

var hitPoints = 100.0;
var deadReplacement : Transform;
var dieSound : AudioClip;

function ApplyDamage (damage : float) {
	// We already have less than 0 hitpoints, maybe we got killed already?
	if (hitPoints <= 0.0)

	hitPoints -= damage;
	if (hitPoints <= 0.0)

function Detonate () {
	// Destroy ourselves
	// Play a dying audio clip
	if (dieSound)
		AudioSource.PlayClipAtPoint(dieSound, transform.position);

	// Replace ourselves with the dead body
	if (deadReplacement) {
		var dead : Transform = Instantiate(deadReplacement, transform.position, transform.rotation);
		// Copy position & rotation from the old hierarchy into the dead replacement
		CopyTransformsRecurse(transform, dead);

static function CopyTransformsRecurse (src : Transform,  dst : Transform) {
	dst.position = src.position;
	dst.rotation = src.rotation;
	for (var child : Transform in dst) {
		// Match the transform with the same name
		var curSrc = src.Find(child.name);
		if (curSrc)
			CopyTransformsRecurse(curSrc, child);

if (hitPoints <= 0.0)

This looks like it would be the problem. You’re checking to see if(hitPoints <= 0.0) in two different parts of the code. What I copy/pasted above is the first check. When this checks and finds that you have no health left, it will return from the function and never perform the second check. Detonate will never be called.

so, i need help, can you please post the whole code the way it is supposed to be?!?!?!?!?!?