How to Code an Elevator with Buttons

Last updated: March 9, 2025

  1. You will need 3 parts for the actual coding part. For this example it will be simple blocks but you can put this in your elevator with up and down buttons. There is an ${color}#019812 button, a ${color}#940000 button, and the ${color}#008fcc platform.

  2. In the ${color}#0b9801 button, open up the code builder and place an at start block and a broadcast event block from Events. In the key, type your trigger word, in this example its "Clicked".

  3. In the ${color}#ad0101 button, open up the code builder and place an at start block and a broadcast event block from Events. In the key, type your trigger word, in this example its "Down".

  4. In your ${color}#0099cc platform, open up the code builder and place 2 when I receive event blocks, with your trigger words in each one. After both, place 2 tween object position in plot blocks from Motion. In the Y put a ${color}[#00a814](positive number for Up), and a ${color}[#a80000](negative number for Down.)

  5. Press play and press the buttons to see your platform go up and down to take you up and down!

Was this article helpful?

Thanks for your feedback!