# Teh counter

**URL:** <https://forum.kirupa.com/t/teh-counter/61585>\
**Category:** Uncategorized\
**Created:** [August 19, 2004, 7:12pm UTC](https://forum.kirupa.com/t/teh-counter/61585 "2004-08-19T19:12:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Skribble](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@Skribble](https://forum.kirupa.com/u/Skribble)\
**Post date:** [August 19, 2004, 7:12pm UTC](https://forum.kirupa.com/t/teh-counter/61585/1 "2004-08-19T19:12:50Z")

</div>

hey guys. im trying to make this counter where u can plus points up to 10 and then it stops, and if u minus points down to zero its stops.

Ive got it so that it stops at 10, but i cant make it work for the minusing.

any help would b e appreciated. thanx

P.S: FLA file is attached

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 19, 2004, 9:38pm UTC](https://forum.kirupa.com/t/teh-counter/61585/2 "2004-08-19T21:38:31Z")

</div>

> [@Skribble](#):
>
> hey guys. im trying to make this counter where u can plus points up to 10 and then it stops, and if u minus points down to zero its stops.
> 
> Ive got it so that it stops at 10, but i cant make it work for the minusing.
> 
> any help would b e appreciated. thanx
> 
> P.S: FLA file is attached

change to  
else {  
if (this.hitTest(\_root.\_xmouse, \_root.\_ymouse) && \_root.setSpeed\>0) {  
\_root.setSpeed -= \_root.num;  
\_root.points += \_root.num;  
}

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 20, 2004, 6:01am UTC](https://forum.kirupa.com/t/teh-counter/61585/3 "2004-08-20T06:01:55Z")

</div>

hey man thanx. that worked great. but i tried to add more variables and use the same thing and now they can all plus up to 10 and the points go up to -30.

i tried adding an if points = 0 then num = 0 but then when u click up it wouldnt plus anything and now im confused ^.^

can anyone help with this please.

_shakes fist at variables_

thanx guys
