The Legend of Gilgamesh if you read it is a Sumerian text written long before the hebrew's Torah. The legend of Gilgamesh is almost exactly the same as the flood of Noah. Gilgamesh had a large boat and took people and animals on it to prevent being killed in the flood. All else of mankind was wiped out. Gilgamesh also sent birds out to look for dry land and like the noah story at first they came back until finally one did not and they knew there was dry land.they then landed on a mountain top and sacrificed an animal to god. Now doesn't this sound exactly like the Noah flood story? Why is that. Was this story by the Sumerians borrowed, and changed a little to fit the hebrew's?
Scholars agree that the stories of Gilgamesh and the biblical flood are similar. However, that they are similar is where it ends.
If you examine the texts of each story they remains an extreme difference between the two.
The biblical flood is a punishment for the extreme depravity that had become rampant.
While Gilgamesh and his story differs in this central theme that is only found in the biblical account.
Having said this, scholars agree that these ancient texts are harmonious and it seems plausible that Gilgamesh and other ancient creation and or flood stories that are found throughout the ancient world are pointing to a door behind which contain conceptual similarities that can only be understood by conceiving that there must have been an original archetype story which oral traditions have offered as a highway in which these stories were aquired throughout the ancient world as they were disseminated through different cultures by word of mouth and finally in written forms.
Who ripped who off is not the proper response. These ancient stories /texts cannot be understood by viewing them through a 21st century lens in which modern man has been condition by influential ideas brought to us by enlightenment philosophers. Ideas like skeptism and relativism to name a few.