Need a Health Bar for my Player Script

Hey Guys I have got a Script but I dont know how to make a Health Bar that I can show the player how many lives he has pls help me
BTW here is the Script :smile:

var currentGun : GameObject;
var distToPickUpGun : float = 6;
var throwGunUpForce : float = 100;
var throwGunForwardForce : float = 300;
var waitFrameForSwitchGuns : int = -1;

var walkAcceleration : float = 5;
var walkAccelAirRacio : float = 0.1;
var walkDeacceleration : float = 5;
@HideInInspector
var walkDeaccelerationVolx : float;
@HideInInspector
var walkDeaccelerationVolz : float;

var cameraObject : GameObject;
var maxWalkSpeed : float = 20;
@HideInInspector
var horizontalMovement : Vector2;

var jumpVelocity : float = 20;
@HideInInspector
var grounded : boolean = false;
var maxSlope : float = 60;

var crouchRacio : float = 0.3;
var transitionToCrouchSec : float = 0.2;
var crouchingVelocity : float;
var currentCrouchRacio : float = 1;
var originalLocalScaleY : float;
var crouchLocalScaleY : float;
var collisionDetectionSphere : GameObject;

@HideInInspector
var waitToPickupAmmo : float = 0;

var currentCell : GameObject;

var health : float = 3000;
var deadBodyPrefab : GameObject;

function Awake ()
{
	currentCrouchRacio = 1;
	originalLocalScaleY = transform.localScale.y;
	crouchLocalScaleY = transform.localScale.y * crouchRacio;
}

function LateUpdate () 
{
	if (grounded)
		rigidbody.useGravity = false;
	else
		rigidbody.useGravity = true;
	
	waitFrameForSwitchGuns -= 1;
	waitToPickupAmmo -= Time.deltaTime;
	
	transform.localScale.y = Mathf.Lerp(crouchLocalScaleY, originalLocalScaleY, currentCrouchRacio);
	if (Input.GetButton("Crouch"))
		currentCrouchRacio = Mathf.SmoothDamp(currentCrouchRacio, 0, crouchingVelocity, transitionToCrouchSec);
	if (Input.GetButton("Crouch") == false  collisionDetectionSphere.GetComponent(CollsionDetectionSphereScript).collisionDetected == false)
		currentCrouchRacio = Mathf.SmoothDamp(currentCrouchRacio, 1, crouchingVelocity, transitionToCrouchSec);
	
	horizontalMovement = Vector2(rigidbody.velocity.x, rigidbody.velocity.z);
	if (horizontalMovement.magnitude > maxWalkSpeed)
	{
		horizontalMovement = horizontalMovement.normalized;
		horizontalMovement *= maxWalkSpeed;		
	}
	
	rigidbody.velocity.x = horizontalMovement.x;
	rigidbody.velocity.z = horizontalMovement.y;
	
	if (grounded){
		rigidbody.velocity.x = Mathf.SmoothDamp(rigidbody.velocity.x, 0, walkDeaccelerationVolx, walkDeacceleration);
		rigidbody.velocity.z = Mathf.SmoothDamp(rigidbody.velocity.z, 0, walkDeaccelerationVolz, walkDeacceleration);}
	
	transform.rotation = Quaternion.Euler(0, cameraObject.GetComponent(MouseLookScript).currentYRotation, 0);
	
	/*if (grounded)
		rigidbody.AddRelativeForce(Input.GetAxis("Horizontal") * walkAcceleration * Time.deltaTime, 0, Input.GetAxis("Vertical") * walkAcceleration * Time.deltaTime);
	else
		rigidbody.AddRelativeForce(Input.GetAxis("Horizontal") * walkAcceleration * walkAccelAirRacio * Time.deltaTime, 0, Input.GetAxis("Vertical") * walkAcceleration * walkAccelAirRacio * Time.deltaTime);
			*/
	if (Input.GetButtonDown("Jump")  grounded)
		rigidbody.AddForce(0,jumpVelocity,0);
	
	if (health <= 0)
	{
		currentGun.GetComponent(GunScript).beingHeld = false;
		currentGun.rigidbody.AddRelativeForce(Vector3(0, throwGunUpForce, throwGunForwardForce));
		Instantiate(deadBodyPrefab, transform.position, transform.rotation);
		collider.enabled = false;
		cameraObject.GetComponent(AudioListener).enabled = false;
		enabled = false;
	}
}

function FixedUpdate ()
{
	if (grounded)
		rigidbody.AddRelativeForce(Input.GetAxis("Horizontal") * walkAcceleration, 0, Input.GetAxis("Vertical") * walkAcceleration);
	else
		rigidbody.AddRelativeForce(Input.GetAxis("Horizontal") * walkAcceleration * walkAccelAirRacio, 0, Input.GetAxis("Vertical") * walkAcceleration * walkAccelAirRacio);
}

function OnCollisionStay (collision : Collision)
{
	for (var contact : ContactPoint in collision.contacts)
	{
		if (Vector3.Angle(contact.normal, Vector3.up) < maxSlope)
			grounded = true;
	}
}

function OnCollisionExit ()
{
	grounded = false;
}

function OnTriggerExit ()
{
	currentCell = null;
}

function OnTriggerStay (hitTrigger : Collider)
{
	if (hitTrigger.tag == "AIpathCell")
		currentCell = hitTrigger.gameObject;

	if (hitTrigger.transform.tag == "StairGoingUp")
		if (!Input.GetButton("Jump")  Vector3.Angle(rigidbody.velocity, hitTrigger.transform.forward) < 90)
			if (rigidbody.velocity.y > 0)
				rigidbody.velocity.y = 0;
	if (hitTrigger.transform.tag == "StairGoingDown")
		if (!Input.GetButton("Jump")  Vector3.Angle(rigidbody.velocity, hitTrigger.transform.forward) < 90)
			rigidbody.AddForce(0,-100,0);


	var current : GunScript = null;
	if (currentGun)
		current = currentGun.GetComponent(GunScript);
	var ammo : AmmoPickupScript = null;
	var gun : GunScript = null;
	if (hitTrigger.tag == "AmmoPickup"  waitToPickupAmmo <= 0)
	{
		ammo = hitTrigger.gameObject.GetComponent(AmmoPickupScript);
		if (current.currentExtraAmmo < current.maxExtraAmmo)
		{
			if (ammo.fromGun)
			{
				gun = ammo.gun.GetComponent(GunScript);
				if (gun.currentExtraAmmo > 0  gun.ammoType == current.ammoType  ammo.gun != currentGun)
				{
					if (gun.currentExtraAmmo >= current.maxExtraAmmo - current.currentExtraAmmo)
					{
						gun.currentExtraAmmo -= current.maxExtraAmmo - current.currentExtraAmmo;
						current.currentExtraAmmo = current.maxExtraAmmo;
					}
					if (gun.currentExtraAmmo < current.maxExtraAmmo - current.currentExtraAmmo)
					{
						current.currentExtraAmmo += gun.currentExtraAmmo;
						gun.currentExtraAmmo = 0;
					}
					if (ammo.pickupSound)
						ammo.gameObject.GetComponent(AudioSource).Play();
				}
			}
			if (!ammo.fromGun)
			{
				if (current.ammoType == ammo.ammoType || ammo.ammoType == -1)
				{
					if (ammo.ammoAmount > 0  !ammo.unlimitedAmmo)
					{
						if (ammo.ammoAmount >= current.maxExtraAmmo - current.currentExtraAmmo)
						{
							ammo.ammoAmount -= current.maxExtraAmmo - current.currentExtraAmmo;
							current.currentExtraAmmo = current.maxExtraAmmo;
						}
						if (ammo.ammoAmount < current.maxExtraAmmo - current.currentExtraAmmo)
						{
							current.currentExtraAmmo += gun.currentExtraAmmo;
							ammo.ammoAmount = 0;
						}
						if (ammo.pickupSound)
							ammo.gameObject.GetComponent(AudioSource).Play();
					}
					if (ammo.unlimitedAmmo)
					{
						current.currentExtraAmmo = current.maxExtraAmmo;
						if (ammo.pickupSound)
							ammo.gameObject.GetComponent(AudioSource).Play();
					}
				}
			}
		}
	}
}

Have you played with Gui before ? Basically you are just needing the width of a gui DrawTexture to be set by the value of your health.

If you want to get real fancy check out some of the many tutorials on the topic. You tube is a good start.