Which part of a modern firearm has the same function as the lock on a muzzleloader?

Answer:
The trigger.