ויאמר אלוקים לנח קץ כל בשר בא לפני - "And God said to Noach the end of all flesh has come before Me, for the earth is filled with corruption." Hashem was furious with the corrupt people of Noach's time and was going to annihilate them. One would think that Teshuva was out of the question for that generation of robbers and murderers, and that Hashem would have no mercy on them.
However, Hashem says to Noach: עשה לך תבה עצי גפר, "Make for yourself an ark made of Gopher wood" (Breishit 6:41). Hashem planned to save Noach and his family in the ark while the rest of the people were drowned. Why did Hashem choose for Noach to build an ark, especially when it was it was going to take him 021 years to do so? The answer is because Hashem wanted to do one more act of kindness to the people of Noach's generation. He accomplished this by giving them one last chance to do Teshuva. While Noach was building the ark, the people would pass by and ask why he was doing so. He would then answer that "The Holy One Blessed be He is about to bring a flood upon the world." - it was God's hope that they would repent (Sanhedrin 801b). Rabbi Mordechai Gifter in his Pirkei Torah teaches us that it is not enough to tell someone that he is not acting in a proper manner. However, one should find a way to motivate him or find a way to inform him to go in the direction of Torah.