# Help with a game

**URL:** <https://forum.kirupa.com/t/help-with-a-game/311956>\
**Category:** Uncategorized\
**Created:** [July 21, 2010, 8:24am UTC](https://forum.kirupa.com/t/help-with-a-game/311956 "2010-07-21T08:24:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ts87](https://avatars.discourse-cdn.com/v4/letter/t/85e7bf/32.png) [@ts87](https://forum.kirupa.com/u/ts87)\
**Post date:** [July 21, 2010, 8:24am UTC](https://forum.kirupa.com/t/help-with-a-game/311956/1 "2010-07-21T08:24:07Z")

</div>

Hello! I’m currently making my own flash game. Everything is going ok for now, but i’ve come across a problem. I want to add health regeneration things 🙂 I have spikes which when touched takes 5 from your life, and i’m using the same code, but with the difference that it suppose to add 5 to your life, but it don’t. So this is the code that i’m wrote:

```auto
onClipEvent (enterFrame) {
    if (this.hitTest(_root.char)) {
       
        if (_root.health.text < 100) {
       
            _root.health.text += 5 ;
       
            unloadMovie(this);
       
        }
        
        if (_root.health.text > 100) {
  
            _root.health.text = 100;
  
            unloadMovie(this);
  
        }
        
        else if (_root.health.text == 100) {
            unloadMovie(this);

        }
    }
            
}

```

So if for instance your health is 85 instead of adding 5 and making it 90 it adds 5 in the back and it becomes 855. What am i doing wrong?!
