# How do I disable player inputs?

**URL:** <https://forum.makecode.com/t/how-do-i-disable-player-inputs/23169>\
**Category:** Help\
**Created:** [October 9, 2023, 6:24pm UTC](https://forum.makecode.com/t/how-do-i-disable-player-inputs/23169 "2023-10-09T18:24:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![FourBacon](https://avatars.discourse-cdn.com/v4/letter/f/48db29/32.png) [@FourBacon](https://forum.makecode.com/u/FourBacon)\
**Post date:** [October 9, 2023, 6:24pm UTC](https://forum.makecode.com/t/how-do-i-disable-player-inputs/23169/1 "2023-10-09T18:24:53Z")

</div>

I need help on how to disable player inputs. ex. if x happens, then button a is disabled. Is there a way or an extension to do this?

---

<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:** [October 9, 2023, 9:58pm UTC](https://forum.makecode.com/t/how-do-i-disable-player-inputs/23169/2 "2023-10-09T21:58:04Z")

</div>

Just create a variable, eg. `aButtonEnabled` and put all of the code in the `on A button pressed` block into an if statement that checks if `aButtonEnabled` is true. Then just set the variable to false when you want to disable the input

---

<div class="post-metadata">

**Author:** ![Mega0star01](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mega0star01/32/14784_2.png) [@Mega0star01](https://forum.makecode.com/u/Mega0star01)\
**Post date:** [October 9, 2023, 10:01pm UTC](https://forum.makecode.com/t/how-do-i-disable-player-inputs/23169/3 "2023-10-09T22:01:34Z")

</div>

i’m not sure if there’s an extension but you could do a variable for the buttons like “a button disable” and on the event you put a true in the variable, then in the button pressed event put a logic block: if “a button disable” false the: (action). if not then: (you could puta shake the screen block so the player knows that he can’t use this button).

---

<div class="post-metadata">

**Author:** ![Luke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/luke/32/32519_2.png) [@Luke](https://forum.makecode.com/u/Luke)\
**Post date:** [October 9, 2023, 10:01pm UTC](https://forum.makecode.com/t/how-do-i-disable-player-inputs/23169/4 "2023-10-09T22:01:47Z")

</div>

Use an if block and a variable

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/0/01b1ec7ca66d229e87a9d0ff7598287d81bb1459.png)  
In this example you can just change **Paused** variable to be false so nothing in the “if then” block runs  
When you want to run it again just change it back to true!

---

<div class="post-metadata">

**Author:** ![Vegz78](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/vegz78/32/1201_2.png) [@Vegz78](https://forum.makecode.com/u/Vegz78)\
**Post date:** [October 9, 2023, 10:07pm UTC](https://forum.makecode.com/t/how-do-i-disable-player-inputs/23169/5 "2023-10-09T22:07:32Z")

</div>

Not sure if it is possible to disable player inputs, but you could make an _if…else if…_ statement for e.g. button A which is empty/has no action for the condition which is true for when x happens.
