How do i make a (Working) health bar

How do i make a script that i attach to an object to display a GUI health bar that goes down when hit by a object (with a rigid body attached)and when it gets to 0 it displays a game over image that i made on Photoshop?

Do a search for “health bar” or “healthbar” on this list and you will find 1000’s of hits…many with scripts or script fragments. Here is a link to one of them: