A (relatively complex) trap where an arrow is fired from a dispenser when an NPC steps on the pressure plate. If he leaves the pressure plate, he is pushed back by a piston, so the whole thing repeats until death.
The trap is quite ineffective for complexity, especially since dropped items are not picked up. But it is a pretty nasty and in a sense elegant trap, with which you can practice a bischen Redstone switching 😉
For Survival situationally useful, you'll have to think about it.
Instructions:Just rebuild it. Blocks can be placed above the circuits, of course. The redstone signal must be inverted once, so that the piston is extended when the pressure plate is NOT entered.
Don't forget to fill the dispenser with a stack of arrows. If you have any questions just comment, have fun!