These types of flintlocks were placed in and around cemeteries to stop people from vandalizing and grave robbing. Lara Croft and Indiana Jones better watch out. These cemetery guns were banned because innocent people were hurt trying to visit graves.
Here is an article about the cemetery gun:
In the 18th and 19th centuries, grave-robbing was a serious problem in Great Britain and the United States. Because surgeons and medical students could only legally dissect executed criminals or people who had donated their bodies to science (not a popular option at the time), a trade in illegally procured corpses sprang up. This cemetery gun, held in the Museum of Mourning Art at the Arlington Cemetery of Drexel Hill, Pa., was one dramatic strategy used to thwart so-called “resurrection men.”
The gun, which the museum dates to 1710, is mounted on a mechanism that allows it to spin freely. Cemetery keepers set up the flintlock weapon at the foot of a grave, with three tripwires strung in an arc around its position. A prospective grave-robber, stumbling over the tripwire in the dark, would trigger the weapon—much to his own misfortune.
Grave-robbers evolved to meet this challenge. Some would send women posing as widows, carrying children and dressed in black, to case the gravesites during the day and report the locations of cemetery guns and other defenses. Cemetery keepers, in turn, learned to wait to set the guns up after dark, thereby preserving the element of surprise.
Because the guns were rented by the week and were prohibitively expensive to buy, the poorer people most likely to end up beneath the anatomist’s knife—historian Michael Sappol writes that these included “black people, criminals, prostitutes, the Irish, ‘freaks,’ manual laborers, indigents, and Indians”—probably wouldn’t have benefited from this form of protection.
Thanks to curator Elizabeth Wojcik of the Museum of Mourning Art at the Arlington Cemetery.