Health/Hunger

Ok so basically i need help in deducting health when hunger = or < 0 and when hunger = 100 health regens 10 per 30 seconds and also make it so hunger slowly goes down overtime im unsure how to do this if you can point me in the right direction that would be great this is what i have so far the hunger dosent seem to lower at all for some reason

#pragma strict

var MaxHealth = 100;
var Health : int;
var MaxHunger = 100;
var Hunger : int;
var HealthlabelPos : Rect =  Rect(100,100,100,20);
var HungerlabelPos : Rect =  Rect(200,100,100,20);



function Start ()
{
	Health = MaxHealth;
	Hunger = MaxHunger;
}

function Update() 
{
    InvokeRepeating("Hungry", 1, 30);
}


function ApplyDammage (TheDamage : int)
{
	Health -= TheDamage;
	
	if(Health <= 0)
	{
		Dead();
	}
}
function Hungry() 
{

    if (Hunger >= 1 || Hunger <= 100) 
    {
     	var Hunger =-1;
    }

}
function Dead()
{
	respawnMenu.playerIsDead = true; 
	Health = MaxHealth;
}

function RespawnStats ()
{
	Health = MaxHealth;
}


  function OnGUI()
  {
         GUI.Label(HealthlabelPos, "Health:" + Health); 
         GUI.Label(HungerlabelPos, "Hunger:" + Hunger);
  }

Don’t quote me on this because I’m not actually sure if this is the case, but I think if you use InvokeRepeating in Update() w/o any conditions it might give you trouble because it would be calling the InvokeRepeat every frame, this may not be true, but is just my guess. Anyway I got your script to work, or atleast the hunger part. Try this out:

#pragma strict
 
var MaxHealth : int = 100;
var Health : int;
var MaxHunger : int = 100;
var Hunger : int;
var HealthlabelPos : Rect =  Rect(100,100,100,20);
var HungerlabelPos : Rect =  Rect(200,100,100,20);
 
 
 
function Start ()
{
	InvokeRepeating("Hungry", 1, 30);
    Health = MaxHealth;
    Hunger = MaxHunger;
}

function Hungry() 
{
 	print("hungry invoked");
    if (Hunger >= 1 && Hunger <= 100) 
    {
        Hunger -= 1;
        print(Hunger);
    }
}


function ApplyDammage (TheDamage : int)
{
    Health -= TheDamage;
 
    if(Health <= 0)
    {
       Dead();
    }
}

function Dead()
{
    respawnMenu.playerIsDead = true; 
    Health = MaxHealth;
}
 
function RespawnStats ()
{
    Health = MaxHealth;
}
 
 
  function OnGUI()
  {
         GUI.Label(HealthlabelPos, "Health:" + Health); 
         GUI.Label(HungerlabelPos, "Hunger:" + Hunger);
  }