# How would I make it so a click to interact event only happens once?

**URL:** <https://forum.makecode.com/t/how-would-i-make-it-so-a-click-to-interact-event-only-happens-once/40453>\
**Category:** Help\
**Created:** [November 14, 2025, 6:42pm UTC](https://forum.makecode.com/t/how-would-i-make-it-so-a-click-to-interact-event-only-happens-once/40453 "2025-11-14T18:42:31Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![june](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/june/32/26577_2.png) [@june](https://forum.makecode.com/u/june)\
**Post date:** [November 14, 2025, 6:42pm UTC](https://forum.makecode.com/t/how-would-i-make-it-so-a-click-to-interact-event-only-happens-once/40453/1 "2025-11-14T18:42:31Z")

</div>

Hi! I’m currently having some trouble with my game. I want to make it so when I click it takes me to the main game, but I also want to make it so the event only happens once (the clicking). I would also greatly appreciate it if someone could help me make it so you would have to click on the actual “start” sprite to enter the game. Thank you! 😃

[https://arcade.makecode.com/S51530-32793-44945-94850](https://arcade.makecode.com/S51530-32793-44945-94850)

if anything is unclear please ask! I tried to include all relevant information ☹

xtra: i used a browser events extension

---

<div class="post-metadata">

**Author:** ![Ima.notarobot](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/ima.notarobot/32/26551_2.png) [@Ima.notarobot](https://forum.makecode.com/u/Ima.notarobot)\
**Post date:** [November 14, 2025, 7:18pm UTC](https://forum.makecode.com/t/how-would-i-make-it-so-a-click-to-interact-event-only-happens-once/40453/2 "2025-11-14T19:18:46Z")

</div>

Welcome to the forums @june! I will help you. Just let me get home. @WoofWoof I got this one 😃

---

<div class="post-metadata">

**Author:** ![Cybercube](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cybercube/32/34628_2.png) [@Cybercube](https://forum.makecode.com/u/Cybercube)\
**Post date:** [November 14, 2025, 7:18pm UTC](https://forum.makecode.com/t/how-would-i-make-it-so-a-click-to-interact-event-only-happens-once/40453/3 "2025-11-14T19:18:55Z")

</div>

make a variable for it. add if variable or “variable”=“number or string” then for the event that happen ones chang the variable so it won’t happen again.

---

<div class="post-metadata">

**Author:** ![Johns\_tired](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/johns_tired/32/34228_2.png) [@Johns\_tired](https://forum.makecode.com/u/Johns_tired)\
**Post date:** [November 14, 2025, 10:21pm UTC](https://forum.makecode.com/t/how-would-i-make-it-so-a-click-to-interact-event-only-happens-once/40453/4 "2025-11-14T22:21:07Z")

</div>

i was gonna say that lol

---

<div class="post-metadata">

**Author:** ![redSprite](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/redsprite/32/34262_2.png) [@redSprite](https://forum.makecode.com/u/redSprite)\
**Post date:** [November 14, 2025, 10:23pm UTC](https://forum.makecode.com/t/how-would-i-make-it-so-a-click-to-interact-event-only-happens-once/40453/5 "2025-11-14T22:23:05Z")

</div>

There’s something called booleans…

* * *

Use a variable that is set to false on startup, once that action is done change it to true.

Make sure the “if” block is in place so we can make the code run if it equals false.

---

<div class="post-metadata">

**Author:** ![june](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/june/32/26577_2.png) [@june](https://forum.makecode.com/u/june)\
**Post date:** [November 20, 2025, 4:36pm UTC](https://forum.makecode.com/t/how-would-i-make-it-so-a-click-to-interact-event-only-happens-once/40453/6 "2025-11-20T16:36:46Z")

</div>

hi! I’m so sorry for the late reply but could you possibly show me how the code would look like? I’m still very to to coding (even w just blocks) so this would help me tons. thank you!

---

<div class="post-metadata">

**Author:** ![Ima.notarobot](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/ima.notarobot/32/26551_2.png) [@Ima.notarobot](https://forum.makecode.com/u/Ima.notarobot)\
**Post date:** [November 20, 2025, 10:31pm UTC](https://forum.makecode.com/t/how-would-i-make-it-so-a-click-to-interact-event-only-happens-once/40453/7 "2025-11-20T22:31:14Z")

</div>

Fixed it. sorry for the wait. All I did was create a variable, Make it true, then When You click your mouse the code asks if it is true. then the code runs and sets the variable to false.

[https://arcade.makecode.com/S56277-18131-43146-65126](https://arcade.makecode.com/S56277-18131-43146-65126)

If you need more help, just @ me.

---

<div class="post-metadata">

**Author:** ![june](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/june/32/26577_2.png) [@june](https://forum.makecode.com/u/june)\
**Post date:** [November 21, 2025, 3:44am UTC](https://forum.makecode.com/t/how-would-i-make-it-so-a-click-to-interact-event-only-happens-once/40453/8 "2025-11-21T03:44:05Z")

</div>

thank you so much! I don’t think I could have figured this out without you lol
