# Increment on button click

**URL:** <https://forum.kirupa.com/t/increment-on-button-click/43440>\
**Category:** Uncategorized\
**Created:** [February 22, 2004, 4:55pm UTC](https://forum.kirupa.com/t/increment-on-button-click/43440 "2004-02-22T16:55:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigbadmilkman](https://avatars.discourse-cdn.com/v4/letter/b/9fc348/32.png) [@bigbadmilkman](https://forum.kirupa.com/u/bigbadmilkman)\
**Post date:** [February 22, 2004, 4:55pm UTC](https://forum.kirupa.com/t/increment-on-button-click/43440/1 "2004-02-22T16:55:25Z")

</div>

Okay I have a textbox that keeps the score of a game.

Now what i want is when the user clicks on a button, for the score to be incremented by 1, but i want it so that when it reaches 10, that the game terminates.

at the moment I have the following code on my button

on (release){  
for (counter=0;counter\<10;++counter);  
}

But this doesn’t seem to work, i have given my textbox a variable name counter.

Can anyone help me?
