So I said in 3 places.
Mesopotamia - cuneiform
China - Chinese
Mesoamerican - Mayan?
He said all those plus Egyptian. I argued that Egyptian was influenced by cuneiform.
Mesoamerican - Mayan?
You have your answer already, but just as a small clarification, Mayan hieroglyphics is the only complete writing system in Mesoamerica, but it actually probably developed out of a type of Olmec proto-writing that most other Mesoamerican scripts (like Mixtec or Aztec scripts) are based on. By complete I mean that, unlike other writing systems in Mesoamerica which have a more restricted range of expression (they are more pictographic), you can use Mayan hieroglyphics to record anything you could say in a Mayan language.
All that to say that yes, Mesoamerica is an independent center of invention for writing but depending on how you define "writing" either Mayan is the only writing system in Mesoamerica or Olmec proto-writing is the first script.
Also, the debate is still out as to what extent Andean khipu are a form of writing, but if you want to be very generous with your definition of "writing" you could say that the Andes are a fourth/fifth center of invention.
tl;dr- this is one of my favorite lectures to give, writing is a fascinating technology; to answer, your question though- it depends.
If you want to be conservative in your answer, you would say that there are only 2 absolutely verifiable independent inventions of writing. This is the line I think you will find in most quality textbooks.
Mesoamerica and Mesopotamia.
It is also possible- and even probable- that Ancient Chinese and Egyptian Hieroglyphs were also independent inventions. But it is also possible that those scripts arose out of a process of diffusion in which, if not the form, then the idea of writing passed to them and allowed the systems to develop. They need not be cases of blueprint copying to still have been influenced by the idea that the technology of writing be useful. Certainly Cuneiform did end up influencing Egyptian writing systems.
There is also the question of when a set of symbols transitions from being meaningful in and of themselves as symbols with no clear set and stable meaning aside from perhaps representing for example an animal or a star pattern and when they become part of a stable systematic way of expressing concrete objects or even abstractions.
Olmec script predates that of the Mayans and Indus script has no indications of being descended from either Mesopotamian or Chinese writing. It seems doubtful that cuneiform and hieroglyphs developed completely independently but that does not mean one was descended from the other, rather that as they were gradually being developed scribes were aware of both.
So I'd say writing developed at least 4 times independently but both of you forgot India.
I would like to add that you are forgetting Rongorongo: writing system originating on Rapa Nui.
It would be better to say that complete writing systems developed X number of times. Incomplete systems have developed many many more times, it's only the explicit connection between sound and symbol that has had a more limited development.
The oldest samples of egyptian writing we have are older than the oldest samples of cuniform writing we have. Günther Dreyer found clay and bone tax tabs at the U-J tomb in Abydos that were dated to ~3200 BC. Here's a news article about the find. Or you can try and get a copy of Dreyer 1998 if you speak German.
Your assumption that written language in Egypt was influenced by cuniform is wrong on another count as well, as the earliest forms of egyptian written language show continuity with the older non-linguistic writing found in caves further south of Abydos.
So that gets us to: 1) egytpian, 2) cuniform, 3) hanzi, 4) mayan, all with a high degree of certainty of being innovated as full written language systems seemingly without external inspiration. We also have 5) indus vally and 6) cretan with a lesser degree of certainty. So 4-6 times, but 4 is the better and more conservative answer in my view.
Also Sanskrit. Sanskrit was originally oral language and written language developed later on. But in the subsequent languages of India [prakrit, telugu, tamil etc] this independent development was not seen.