# Life system

**URL:** <https://forum.kirupa.com/t/life-system/176776>\
**Category:** programming\
**Created:** [January 26, 2006, 7:50pm UTC](https://forum.kirupa.com/t/life-system/176776 "2006-01-26T19:50:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![igotgames](https://avatars.discourse-cdn.com/v4/letter/i/91b2a8/32.png) [@igotgames](https://forum.kirupa.com/u/igotgames)\
**Post date:** [January 26, 2006, 7:50pm UTC](https://forum.kirupa.com/t/life-system/176776/1 "2006-01-26T19:50:16Z")

</div>

ok, in my game im setting it up where u got 4 lifes… with 5 HPs each… when u miss something u loose a life

ok right now im testing… jst got the 4 lifes… i just did it like u would a score

on main frame  
lifes = 4;

then…  
onClipEvent (enterFrame) {  
if (this.hitTest(\_root.Ground\_MC)) {  
\_root.score = \_root.score -=10;  
\_root.lifes = \_root.lifes -=1  
this.gotoAndStop(10);  
}  
}

then i put on the mainframe

if (lifes\<1){  
gotoAndStop(5)  
}

it dnt work?
