How can I make a health bar?

How do I make you lose a life when you hit a certain block? Please help. Thanks, you guys are great.

http://forum.flowlab.io/discussion/100/health-bar#Item_4