Minecraft – Is it possible to invalidate a dispenser after it has been used once

minecraft-java-editionminecraft-redstone

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?

Best Answer

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.