I need help with my code.

My code doesn’t want to work. Every time I put in my code it keeps disabling it. Is there anything i can do?

Can you post a screenshot of what you’re seeing?

There are two cases where MakeCode disables blocks:

  1. When statement blocks are placed outside of an event block
  2. When two identical events are placed on the workspace

For case #1, all statement blocks need to be within an event blocks (the blocks with a “mouth”). If they are placed directly on the workspace they will get disabled like this:

outside-event

For case #2, some events (like the controller events) aren’t allowed to be duplicated on the workspace; each instance of the block needs to have at least one argument that is different.

For example, I can have an “on A button pressed” block and an “on B button pressed” block on the workspace because the button argument is different. Similarly, I can have an “on B button pressed” and an “on B button released” event because the pressed/released argument is different. However, I can’t have two “on B button pressed” events because both arguments are the same:

duplicate-event

1 Like