health bar script please help

hello im having trouble making the player die when his health reaches 0 this is my script just need help with the die part here is my script:

var currentHealth = 100;
var maxHealth = 100;
var minHealth = 1;

if(currentHealth <= minHealth);
currentHealth = 0;

if(currentHealth >= maxHealth); 
currentHealth = 100;

//Code detect death

var health : float = 100 ;
function Update ( )
{
	if (  Mathf.Ceil ( health ) == 0 )
	{
		PlayerIsDead . . . . 
	}else{
		health -= 1 * Time.deltaTime ;
	}
}

Simple solution:

function FixedUpdate(){
  if( currentHealth <= minHealth ){
    // player is dead -- careful this doesn't get called over and over!
  }
}

Here’s a coroutine solution. You call CheckIfDead() once and it sits in the background and checks every so often.

function Start(){
  ...
  CheckIfDead();
}

function CheckIfDead(){
  while( currentHealth > minHealth ){
    yield WaitForSeconds(0.1); // check to see if player has died ever 0.1s
  }
  // this code executes when the character is dead
}