Well God can't lie and that says all of the people were killed and it later says all the animals and plants were destroyed so unless the whole earth was flooded, it couldn't have happened
No. I was once where you are (as a young earth creationist.) I had a very difficult time over multiply decades in separating cherished TRADITIONS with what the Bible actually states. You may have to consult a solid Hebrew Bible commentary to see it, but Genesis makes NO claims of a global/planet-wide flood. (Hopefully by now you've seen my more detailed exposition of this which I posted this morning.)
But here's some additional relevant thoughts:
1) When Genesis that people from all the earth and every nation went to Egypt to buy grain from Joseph during the famine, did that "all" and "every" mean that people from Japan, South America, and Cuba journeyed to Egypt.
2) When the Acts of the Apostles tells us that men of every nation were in Jerusalem and heard Peter's Pentecost sermon, were citizens of China, Madagascar, and Fiji present?
One of the more foolish mantras which even the local seminary professors who sometimes preached at my childhood church used with embarrassing frequency was this: "When the Bible says ALL, you should believe it! ALL means ALL and that's ALL that ALL means!" Ridiculous. We don't observe such "rules" in our own English language and culture and you can bet that the ancient Hebrews and the Koine Greek writers of the New Testament didn't either.
So what does that do to our understanding of Genesis? We can LITERALLY interpret the text without falling into such errors. We can affirm that ALL OF ADAM'S IMAGO DEI LINEAGE WAS DESTROYED IN THE FLOOD (except those on the ark)---even though other Homo sapiens NOT of that description continued to live outside of the flood region.
Noah's world WAS destroyed! And the text only says that the ERETZ (the land) was flooded---not "planet earth" [of which they had no unique vocabulary word to describe.] Yes, Noah COULD have simply left the region if the purpose of the ark was ONLY to save him. But the Bible says it was a means of salvation from the coming judgement---and the New Testament refers to his testimony even while the ark was being prepared. Indeed, Christian theologians have long considered the ark a "type of Christ". Yes, God could have saved Noah and family using other methods----just as God could simply have forgiven mankind of its sins and avoided the cross of Jesus Christ. Similarly, the Ark was necessary because that was God's will for how he wished to carry out his salvation plan for Noah and family while the rest of the IMAGO DEI lineage of Adam was judged in a great flood which destroyed "everything under the sky" [i.e., the heavens.] All of the expressions/phrase which YOU assume mean "planet earth" were simply the Hebrew way of describing Noah's world, the ERETZ.
Indeed, even in the oft quoted Petrine passage about Noah's world, the writer chose the Greek word KOSMOS and not GE----because he was stressing that Noah's "world of people" was destroyed by the flood, not the "world of rocks and continents". Had PLANET EARTH been the extent of the flood, GE would have been the obvious choice. But it was NOAH'S WORLD that was destroyed in the flood.
I encourage you not to remain stuck in the mire of TRADITION like I was. It took me a very long time to push tradition aside and allow the Bible to speak for itself. And that is when I began to see many things, such as the myth of a global flood ----and fallacies like a 6,000 year old earth. Part of my blindness was my assumption that evidence from God's creation could be ignored----as if God's creation was a "mistaken revelation". I didn't understand that God provides abundant answers to our questions in BOTH his BIBLE and his CREATION. They tells us one story of billions of years of earth history and the wondrous evolutionary processes which God created! Praise God!