You should do something like this (use the Started and Stopped Flying events to connect to your gate close and open pins as you see fit):