This is the bare-bones of what it would start out like, also this isn't a place to request scripts but to learn how to do it yourself.
PHP Code:
function onCreated() {
this.life = 100;
this.chat = this.life;
}
// Due to forums filter s hit will show up as **** so you have to type it in yourself.
function onWa****() {
this.life--;
this.chat = this.life;
}