I am making a map in Minecraft that other people can play. I have a dispenser with an iron, golden and diamond sword in it. I want the player to be able to use this dispenser only once. How would I do this?
Make the switch also activate some water (a current passing glitched water will make it flow normally) to wash away part of the redstone, stopping further current.
Wire up switch to TNT to remove dispenser after use.
Use a Latch. This way, the first time the switch is activated, it will activate the dispenser. Subsequent presses will not have any effect. This simplest way to do this is to connect the output of an OR gate to one of the inputs (the other input to the switch, and the dispenser also connected to the output). This way it will 'stick' on once activated, and further button presses will do nothing.
The simplest way to accomplish this is to build an RS-NOR latch, and wire the input and the dispenser to it. When you activate the input, the RS-NOR will flip, causing it to stay on. This means that no matter how many times you press the button, the dispenser will only dispense one time (unless of course you reset the latch).
This is an example of what the contraption may look like from the outside.
The following image is a look at the actual RS-NOR latch within the circuit. This is a vertical RS-NOR latch, because it only takes up one block wide of space (with the exception of the button, which isn't needed). When the button in the first image is pressed, it triggers the bottom redstone torch in this image to turn off, which then makes the wire running on the top of the latch turn off. The redstone torch on the left side of the latch turns on, giving continuous power the latch and not allowing subsequent button presses to do anything. While this is happening, it also powers the wiring extending downwards, which is wired to the dispenser.
The button pictured, however, acts as a reset switch, which is helpful when doing maintenance.
Finally, here is a broader look at the entire circuit.