# mp.isConnected command causing errors

**URL:** <https://forum.makecode.com/t/mp-isconnected-command-causing-errors/22277>\
**Category:** Arcade\
**Created:** [September 5, 2023, 3:02pm UTC](https://forum.makecode.com/t/mp-isconnected-command-causing-errors/22277 "2023-09-05T15:02:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cngsensei](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cngsensei/32/10318_2.png) [@cngsensei](https://forum.makecode.com/u/cngsensei)\
**Post date:** [September 5, 2023, 3:02pm UTC](https://forum.makecode.com/t/mp-isconnected-command-causing-errors/22277/1 "2023-09-05T15:02:16Z")

</div>

The following creates errors:

 ![multiplayer sample code](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/f/ffbb46879de1800761e0de2917d67850e0f2bef6.png)

Is the “mp.isConnected” functionality available yet? I couldn’t find documentation.

Trying to check to see how many people are connected to create a 2- 3- and 4-player game without asking the players how many players there are.

---

<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:** [September 5, 2023, 5:58pm UTC](https://forum.makecode.com/t/mp-isconnected-command-causing-errors/22277/2 "2023-09-05T17:58:49Z")

</div>

Use if else by clicking the plus on the if block instead of 4 seperate if blocks

---

<div class="post-metadata">

**Author:** ![cngsensei](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cngsensei/32/10318_2.png) [@cngsensei](https://forum.makecode.com/u/cngsensei)\
**Post date:** [September 5, 2023, 6:47pm UTC](https://forum.makecode.com/t/mp-isconnected-command-causing-errors/22277/3 "2023-09-05T18:47:57Z")

</div>

That’s not the issue. The “player x connected” feature crashes MakeCode.

---

<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:** [September 5, 2023, 9:03pm UTC](https://forum.makecode.com/t/mp-isconnected-command-causing-errors/22277/4 "2023-09-05T21:03:43Z")

</div>

I was thinking of an alternative that might not crash, I’m not too sure what the issue is sorry! 😅
