# Disabling all the code

**URL:** <https://forum.makecode.com/t/disabling-all-the-code/27178>\
**Category:** micro:bit\
**Created:** [February 22, 2024, 5:35pm UTC](https://forum.makecode.com/t/disabling-all-the-code/27178 "2024-02-22T17:35:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Muqianji](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@Muqianji](https://forum.makecode.com/u/Muqianji)\
**Post date:** [February 22, 2024, 5:35pm UTC](https://forum.makecode.com/t/disabling-all-the-code/27178/1 "2024-02-22T17:35:55Z")

</div>

Is there any possible way to create or find an extension that allows me to stop all code from running unless a certain requirement is met?  
If yes please do tell me 😃

---

<div class="post-metadata">

**Author:** ![dsssssssss9](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dsssssssss9/32/861_2.png) [@dsssssssss9](https://forum.makecode.com/u/dsssssssss9)\
**Post date:** [February 22, 2024, 10:21pm UTC](https://forum.makecode.com/t/disabling-all-the-code/27178/2 "2024-02-22T22:21:57Z")

</div>

Hi

What sort of requirement are you thinking of ?

Regards

---

<div class="post-metadata">

**Author:** ![Muqianji](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@Muqianji](https://forum.makecode.com/u/Muqianji)\
**Post date:** [February 23, 2024, 7:11pm UTC](https://forum.makecode.com/t/disabling-all-the-code/27178/3 "2024-02-23T19:11:25Z")

</div>

For example, if a binary option of a button is switched from 0 to 1, then the rest of the code would be allowed to run, or else the rest of the code fwould be denied from running.

---

<div class="post-metadata">

**Author:** ![Cursedeclipse](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cursedeclipse/32/13499_2.png) [@Cursedeclipse](https://forum.makecode.com/u/Cursedeclipse)\
**Post date:** [February 23, 2024, 10:40pm UTC](https://forum.makecode.com/t/disabling-all-the-code/27178/4 "2024-02-23T22:40:21Z")

</div>

put the code in an if loop.

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [February 24, 2024, 1:02am UTC](https://forum.makecode.com/t/disabling-all-the-code/27178/5 "2024-02-24T01:02:15Z")

</div>

While loops pause everything also while they are running. You could do something like  
While ((GameRunning) = (False));  
(Whatever you want can do here)
