# A confusing problem in my new game

**URL:** <https://forum.kirupa.com/t/a-confusing-problem-in-my-new-game/63439>\
**Category:** Uncategorized\
**Created:** [September 6, 2004, 11:27pm UTC](https://forum.kirupa.com/t/a-confusing-problem-in-my-new-game/63439 "2004-09-06T23:27:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![alligatooor](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@alligatooor](https://forum.kirupa.com/u/alligatooor)\
**Post date:** [September 6, 2004, 11:27pm UTC](https://forum.kirupa.com/t/a-confusing-problem-in-my-new-game/63439/1 "2004-09-06T23:27:56Z")

</div>

there is a really stupid problem out there i ve put some counter that when  
any player of the 2 players scored at 1st he counts his score only & when the other one score after while the engine doesn’t count it 2 the 2nd player so stupid…!i found out something that the compiler write the score 2 the 2nd player  
but in the shape of ones example: if i scored 6 points the compiler writes 111111 instead of 6 help…!  
:cubs:  
any way i dragged the file & if any one noticed some thing please let me know ![](http://forum.kirupa.com/uploads/kirupa/755/062222e6fedaef86.gif)  
\<!-- / message --\>\<!-- attachments --\>

---

<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:** [September 7, 2004, 4:23am UTC](https://forum.kirupa.com/t/a-confusing-problem-in-my-new-game/63439/2 "2004-09-07T04:23:09Z")

</div>

_if i scored 6 points the compiler writes 111111 instead of 6 help…!_

You’re adding it as a string instead of an integer …

---

<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:** [September 7, 2004, 6:04pm UTC](https://forum.kirupa.com/t/a-confusing-problem-in-my-new-game/63439/3 "2004-09-07T18:04:03Z")

</div>

quick solution is to multiply the string by 1, or adding 0, then add the next string (do this again).

or, when setting up the score, define it live: var score\_1p = 0;  
and then when adding to the score, use: score++;  
and when subtracting: score–;

---

<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:** [September 7, 2004, 10:54pm UTC](https://forum.kirupa.com/t/a-confusing-problem-in-my-new-game/63439/4 "2004-09-07T22:54:08Z")

</div>

hey guys i tried doing all the strings & multipling stuff before but it didn’t work i didn’t think it 's about define a variable or putting ++ cause it work some times  
so please guys try 2 upload the fla & c exactly what’s wrong!!! & thanks any way

---

<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:** [September 9, 2004, 7:10am UTC](https://forum.kirupa.com/t/a-confusing-problem-in-my-new-game/63439/5 "2004-09-09T07:10:28Z")

</div>

in fact nothing is wrong, your textfields are a couple of frames ahead the main stuff,  
so it would work if you declare the vars on first frame,

//on frame 1  
var mscore, ascore

i tested this and it seems to work

---

<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:** [September 9, 2004, 9:23pm UTC](https://forum.kirupa.com/t/a-confusing-problem-in-my-new-game/63439/6 "2004-09-09T21:23:34Z")

</div>

hey tofuisonmyside thank u 2 much finally it worked, it was almost getting me crazy  
thank u pal…
