Modelling the chemical evolution of molecular clouds as a function of metallicity