# Why does On Score only work one time?

**URL:** <https://forum.makecode.com/t/why-does-on-score-only-work-one-time/17722>\
**Category:** Help\
**Created:** [February 2, 2023, 5:28pm UTC](https://forum.makecode.com/t/why-does-on-score-only-work-one-time/17722 "2023-02-02T17:28:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdburnside](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@jdburnside](https://forum.makecode.com/u/jdburnside)\
**Post date:** [February 2, 2023, 5:28pm UTC](https://forum.makecode.com/t/why-does-on-score-only-work-one-time/17722/1 "2023-02-02T17:28:45Z")

</div>

I have used the On Score event twice in a program…at On Score 10 and On Score 50. The code in the first event runs properly but the code in the second event (50) never runs. It appears the event can only be used once?

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [February 2, 2023, 6:13pm UTC](https://forum.makecode.com/t/why-does-on-score-only-work-one-time/17722/2 "2023-02-02T18:13:49Z")

</div>

Could you share the code? It would make it a lot easier to diagnose the issue at hand.

---

<div class="post-metadata">

**Author:** ![jdburnside](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@jdburnside](https://forum.makecode.com/u/jdburnside)\
**Post date:** [February 2, 2023, 7:28pm UTC](https://forum.makecode.com/t/why-does-on-score-only-work-one-time/17722/3 "2023-02-02T19:28:53Z")

</div>

> **[Using On Score sample](https://arcade.makecode.com/S00768-12392-99934-68620)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

Is the link ok, or should I use a screenshot?

---

<div class="post-metadata">

**Author:** ![jdburnside](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@jdburnside](https://forum.makecode.com/u/jdburnside)\
**Post date:** [February 3, 2023, 6:10pm UTC](https://forum.makecode.com/t/why-does-on-score-only-work-one-time/17722/4 "2023-02-03T18:10:07Z")

</div>

This is obviously a little different than the previous question but gets the point across. The original question came from a students code…

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [February 3, 2023, 8:40pm UTC](https://forum.makecode.com/t/why-does-on-score-only-work-one-time/17722/5 "2023-02-03T20:40:52Z")

</div>

I’m sorry, but I honestly have no idea what could be causing this…  
It could be an internal issue/bug

---

<div class="post-metadata">

**Author:** ![shoryuken](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/shoryuken/32/7792_2.png) [@shoryuken](https://forum.makecode.com/u/shoryuken)\
**Post date:** [February 6, 2023, 6:34am UTC](https://forum.makecode.com/t/why-does-on-score-only-work-one-time/17722/6 "2023-02-06T06:34:36Z")

</div>

Hi from NZ,

Had this issue before with some students (Using score to trigger next level) and could never get more than 1 ‘On score \_\_’ block to trigger. We never got to the bottom of it…

This was the temporary solution that we found using the On Game Update block in conjunction with a variable score check.

Hope this is some food for thought for your student with the same issue as us!

> **[Using On Score sample (Possible solution?)](https://arcade.makecode.com/S32304-59058-27640-28648)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![jdburnside](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@jdburnside](https://forum.makecode.com/u/jdburnside)\
**Post date:** [February 6, 2023, 6:49am UTC](https://forum.makecode.com/t/why-does-on-score-only-work-one-time/17722/7 "2023-02-06T06:49:31Z")

</div>

My only thought is that it is designed to run only one time. There may be a flag in the procedure that gets set once it runs to keep it from repeating over and over. I need to look at the entire procedure in either Javascript or Python. It may be as simple as resetting the flag variable after using it but it may not be possible to do globally if the variable is defined locally only.

Thanks for looking into this…I was hoping for a quick/easy answer.

Dave
