# How to put a counter

**URL:** <https://forum.kirupa.com/t/how-to-put-a-counter/17953>\
**Category:** Uncategorized\
**Created:** [April 11, 2003, 9:30am UTC](https://forum.kirupa.com/t/how-to-put-a-counter/17953 "2003-04-11T09:30:35Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![vdesigns](https://avatars.discourse-cdn.com/v4/letter/v/ba9def/32.png) [@vdesigns](https://forum.kirupa.com/u/vdesigns)\
**Post date:** [April 11, 2003, 9:30am UTC](https://forum.kirupa.com/t/how-to-put-a-counter/17953/1 "2003-04-11T09:30:35Z")

</div>

have tried to make a login sequence where a usre gets three attempts,trys. and then is given a non authorization message.  
please help with this:(

---

<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:** [April 11, 2003, 3:39pm UTC](https://forum.kirupa.com/t/how-to-put-a-counter/17953/2 "2003-04-11T15:39:51Z")

</div>

you would need to use something like this:

```auto

if( i<3) {
if(psw != "sesame") {
i++
psw = ""
} else {
//actions to be executed when password is right goes here
}
} else {
trace ("You Are Not Authorized!!")
}

```

---

<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:** [May 5, 2003, 7:16pm UTC](https://forum.kirupa.com/t/how-to-put-a-counter/17953/3 "2003-05-05T19:16:25Z")

</div>

> \*Originally posted by ahmed \*  
> \*\*you would need to use something like this:

```auto

if( i<3) {
if(psw != "sesame") {
i++
psw = ""
} else {
//actions to be executed when password is right goes here
}
} else {
trace ("You Are Not Authorized!!")
}

```

\*\*

will that work for a programing a game?

i mean if i made a box and made level codes would that work on it?

---

<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:** [May 5, 2003, 11:59pm UTC](https://forum.kirupa.com/t/how-to-put-a-counter/17953/4 "2003-05-05T23:59:13Z")

</div>

can anyone tell me?

---

<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:** [May 6, 2003, 12:06am UTC](https://forum.kirupa.com/t/how-to-put-a-counter/17953/5 "2003-05-06T00:06:51Z")

</div>

You would probably need to change the code around a little but yes it should work. Why don’t you try it out and see?

---

<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:** [May 6, 2003, 12:11am UTC](https://forum.kirupa.com/t/how-to-put-a-counter/17953/6 "2003-05-06T00:11:07Z")

</div>

> \*Originally posted by Jubba \*  
> \*\*You would probably need to change the code around a little but yes it should work. Why don’t you try it out and see? \*\*

okay i will try if i can’t could u possibly help me?

---

<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:** [May 6, 2003, 12:18am UTC](https://forum.kirupa.com/t/how-to-put-a-counter/17953/7 "2003-05-06T00:18:29Z")

</div>

someone will be able to. I have too much work to do…

---

<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:** [May 6, 2003, 12:31am UTC](https://forum.kirupa.com/t/how-to-put-a-counter/17953/8 "2003-05-06T00:31:14Z")

</div>

hmm i edited it and also added it to a form…

it didn’t work i could’t code it to triger a level:smirk:
