HelloCustomerand welcome to JustAnswer.
To be certain about the admissibility in court
of any polygraph test result, I would have to know where you are located.
Generally speaking, however, such tests are useable only as an investigative tool and are not admissible in court. Whether or not police officers would rely on the failure to pass a polygraph to make an arrest would also depend on other facts (such as the believability of your roommate's statements that you took the money, any other incriminating statements made by you and any other evidence they may have).
The fact that your roommate has accused others of taking his money and the discrepancies in his claims about how much is missing will diminish his credibility, so even if you do not pass the polygraph, either the investigators or the prosecutor may decide that the evidence is not strong enough to warrant prosecution.
Make sure the polygraph examiner knows that you are taking medication, as that may effect the validity of the test results.
Thanks for asking your question here on JustAnswer and good luck with this situation. If you have any other questions, please let me know.