There is lots of room for discussion, since this we are talking about a 1,800+ year old text that has been translated from ancient Latin into modern English, but this quote is likely derived from Meditations 2.11.
My "Penguin Books" copy of Meditations, translated by Maxwell Staniforth in 1964 gives the passage as follows (emphasis mine):
"In all you do or say or think, recollect that at any time the power of withdrawal from life is in your own hands. If gods exist, you have nothing to fear in taking leave of mankind, for they will not let you come to harm. But if there are no gods, or if they have no concern with mortal affairs, what is life to me, in a world devoid of gods or devoid of Providence? Gods, however, do exist..."
I'm not a huge fan of the MIT text that Alan Stedall referenced, because I'm not reading Meditations as an academic, and I find the language kind generally less accessible. That said, I understand it is a highly regarded translation. The same passage in that text reads (again, emphasis mine):
"Since it is possible that thou mayest depart from life this very moment, regulate every act and thought accordingly. But to go away from among men, if there are gods, is not a thing to be afraid of, for the gods will not involve thee in evil; but if indeed they do not exist, or if they have no concern about human affairs, what is it to me to live in a universe devoid of gods or devoid of Providence? But in truth they do exist..."
Now, I rated this "Partially True" because it appears to be based on an actual quote, but either taken out of context or mis-translated.
The phrase "they will not care how devout you have been, but will welcome you based on the virtues you have lived by" is attempting to modernize an idea that is in truth closer to "they will guide you away from evil", and the second concept is less as "[you] will have lived a noble life" and more as "nothing matters because there is no reason for anything."