Tom Selleck is fleeing from an evil mad scientist with a super gun (played by Gene Simmons from Kiss) so he gets into a freight elevator on a building site — only to go hundreds of feet up, and get trapped, when the elevator breaks down. And then the deadly robot insects show up...
This is a scene from Runaway, the 1984 movie directed by Michael Crichton from his own script. It takes place in the near future, when robots are everywhere — and someone is turning them into (what else?) killers. This sequence is still surprisingly effective, especially the bit where the robot suddenly sticks out a sharp blade and stabs Selleck in the hand.
Although who would design an elevator where the override button is underneath the lift, so you have to climb out and swing underneath to get it moving again? (I guess you're supposed to lift that hatch and reach under, but still.)