Made an interesting observation. Used the code that Nicoliathan provided, except split
Begin DEM_Elevator_Button; DEMNwelevator == 0 for elevator at lower station; DEMNwelevator == 1 for elevator ascending; DEMNwelevator == 2 for elevator at upper station; DEMNwelevator == 3 for elevator descendingif ( onactivate == 1 ) if ( DEMNwelevator == 0 ) set DEMNwelevator to 1 ; ascending elseif ( DEMNwelevator == 2 ) set DEMNwelevator to 3; descending endifendifEnd DEM_Elevator_Button
into two parts, one for the up button, the other for the down button.
Begin DEM_Elevator_Buttonif ( onactivate == 1 ) if ( DEMNwelevator == 0 ) set DEMNwelevator to 1 ; ascending endifendifEnd DEM_Elevator_Button
Begin DEM_Elevator_Button2; DEMNwelevator == 0 for elevator at lower station; DEMNwelevator == 1 for elevator ascending; DEMNwelevator == 2 for elevator at upper station; DEMNwelevator == 3 for elevator descendingif ( onactivate == 1 ) if ( DEMNwelevator == 2 ) set DEMNwelevator to 3; descending endifendifEnd DEM_Elevator_Button2
What I also did, was set the elevator to play a sound when the descent or ascent finished.
Begin DEM_Elevatorscriptfloat timerif ( menumode == 1 ) returnendifif ( DEMNwelevator == 1 ) ; ascend set timer to ( timer + GetSecondsPassed ) if (timer <= 26) MoveWorld Z -270 else PlaySound "Dingsound" set timer to 0 set DEMNwelevator to 2 endifendifif ( DEMNwelevator == 3 ); descend set timer to ( timer + GetSecondsPassed ) if (timer <= 26) MoveWorld Z 270 else PlaySound "windsound" set timer to 0 set DEMNwelevator to 0 endif endifendifEnd DEM_Elevatorscript
Now, here's the kicker. When it gets to the top, it plays the Dingsound, and when the up button is pressed again, it plays Dingsound.
And when the down button is pressed, it plays the windsound, and doesn't descend.