A multifunctional lock comprises a lock shell (1), a lock bar (3), movable tooth pieces (4), a support (5) for sliding blocks, sliding blocks (6) and a guide slot unit (8) for the insertion of a key. Wherein, an elastic element is provided between the lock bar and the support, the sliding blocks at least partially extend into the keyway of the unit. When the lock is unlocked, a projection of the unit has two operating positions, in one of which the projection is received into the cut of the shell and the upper teeth of the tooth pieces disengage from the bottom teeth of the sliding blocks, in another it is out of the cut and the upper teeth engage with the bottom teeth. The key of the lock can be changed many times.