GUI HEALTH BAR HELP

I AM MAKING AN FPS GAME AND I WANA ADD A HEALTH BAR WHIT 5 2D TEXTURE THE TEXTURE IS DELETED WHEN HE LOST HEALTH AND WHEN I GET HEALTH THE TEXTURE IS ADDED BAD THE MAXI TEXTURES IN THE BAR IS FIVE
I WANA THE SCRIPT IN JAVA SCRIPT PLZ

It would really help if you included the line number of your error message - that would have enabled us to point out the problem straight away rather than having to scour through your code. But, anyway, the problem is here:

Instantiate(bulletTex2[Random.Range(0,3)], hit.point, Quaternion.FromToRotation(Vector3.up, hit.normal));  
Instantiate(bulletTex[Random.Range(0,3)], hit.point, Quaternion.FromToRotation(Vector3.up, hit.normal));

bulletTex and bulletTex2 are both GameObjects. So bulletTex[Random.Range(0,3)] doesn’t make sense. If you intended them to be an array you should have declared them as such on lines 5-7:

var bulletTex : GameObject[]; // creates an array to use random textures of bullet holes
var bulletTex2 : GameObject[]; // creates an array to use random textures of bullet holes