About letting game know, if health equals to zero, just put in your main while loop this comparison "while(my.health > 0)", so everything in main loop will run till players health more that zero, I advice you to start from AUM, there are allot of useful snippets for you my friend. I have ICQ: 581003459 contact me if you'll need any help, or just PM me, I'll be glad to help

Good luck