https://en.m.wikipedia.org/wiki/Flood_mythThat's a good read. The flood legend occurs in many cultures. Many that didn't have written words what were only oral stories.
Oral stories change, but the prevailing message is eerily similar in all of them.