Episode 247: "Frame of Mind" 

Riker is put in charge of an undercover mission to Tilonus IV, a planet that has descended into anarchy. Since the trip there will take a few days, Riker is able to retain his starring role in the ship's play while he prepares for the dangerous mission. However, he soon begins experiencing an unusual sensation that people, especially a strange alien lieutenant, are staring at him. Troi tells him this can be attributed to his getting into his character that of a mental patient trapped in an asylum. However, when he performs the play, Riker is shocked when the set suddenly becomes an actual asylum cell. The audience disappears, leaving Riker in a real mental ward with a real alien doctor.
The therapist, Dr. Syrus, tells Riker that the play is a delusion, and that he is in a Tilonus mental hospital. Later, an attendant named Mavek escorts Riker to the Common Area, where he sees a doctor who looks just like the alien who was haunting him on the U.S.S. Enterprise. Mavek tells Riker he was brought to the hospital because he committed murder. A panicked Riker tries to attack Mavek, but is subdued and injected with an alien syringe. Riker suddenly sits bolt upright in bed on the Enterprise, relieved that it was all a dream.

Riker and Beverly attribute the dream to nervousness about the play, which is set for that evening. During the performance, Riker is distracted by flashes of his nightmare, and shocks the audience when he angrily confronts Lieutenant Suna, the alien he saw in his nightmare and aboard the Enterprise. Beverly takes Riker to Sickbay and examines him, but can find nothing wrong. Riker then tries to walk back to his quarters, but hallucinates that he's walking in the asylum. When he finally reaches his quarters and closes the door, it locks, and he is in the cell again.

Convinced that he is losing his mind, Riker tells Dr. Syrus that he is ready to cooperate. The doctor subjects Riker to Reflection Therapy, observing Riker use images of Picard, Troi, and Worf to represent different parts of his own psyche. He then sees an image of the alien lieutenant, who according to Dr. Syrus is actually the hospital administrator. The images of the Enterprise officers try to convince Riker that he is still on the starship, but Riker dismisses them, telling them they are not real. Later, Beverly joins Riker in the Common Area, tells him this is all a part of his mission on Tilonus IV, and that the crew is attempting to get him out. Riker, however, refuses to acknowledge her. Then, that night, Data and Worf break into Riker's cell in an effort to free him, but Riker breaks away and runs to the guards, refusing to trust that the Enterprise officers are anything more than delusions.

Worf and Data are able to defeat the guards and transport Riker back to the Enterprise against his will. But while Picard informs Riker that he was abducted during his undercover mission, Riker reacts to a minor head wound Beverly can't seem to stop from bleeding. Struggling to regain his grip on reality, he volleys between delusions of the ship, the play and the alien asylum, until he finally wakes up in a lab, with a probe connected to his head and the alien doctors surrounding him the leader being the mysterious alien he had been encountering over and over again. Seeing that he is dressed in the undercover costume he was given for his mission to Tilonus IV, he realizes that this Is reality and hurriedly locates his communicator. Before the aliens can stop him, Riker calls for an emergency transport and is beamed safely back to the Enterprise, where he learns the truth: he was abducted during his mission and used his last memory of the Enterprise the play to defend himself against experiments the aliens performed on his brain.

Production: 247
Season: 6 Episode: 21
Air Date: 05.03.1993
Stardate: 46778.1
Patrick Stewart as Jean-Luc Picard
Jonathan Frakes as William Riker
Brent Spiner as Data
LeVar Burton as Geordi La Forge
Michael Dorn as Worf
Gates McFadden as Beverly Crusher
Marina Sirtis as Deanna Troi
David Selsburg as Doctor Syrus
Andrew Prine as Administrator
Gary Werntz as Mavek
Susanna Thompson as Inmate
If one includes the movies, nearly every member of the "Star Trek" (1966) crew has appeared in this series and interacted with the new crew - Kirk (in Star Trek: Generations (1994)), Bones (in Encounter At Farpoint), Scotty (in Relics) and Spock (in Unification, parts 1 & 2). Chekov and Scotty also appear in Star Trek: Generations (1994), but they do not interact with the Next Generation crew. Only Uhura and Sulu have not, but the former did appear in the "Star Trek: Deep Space Nine" (1993) episode: Trials and Tribble-ations with Kirk, Spock, McCoy, Scott, Chekov & the DS9 crew; while the latter appears in the "Star Trek: Voyager" (1995) episode: Flashback (and is mentioned as one of Chakotay's contemporaries in Tattoo).

Click this link to view the complete script in a TXT format

                        "Frame of Mind" 
                          Written by 
                         Brannon Braga 
                          Directed by 
                          Jim Conway 
Copyright 1992 Paramount Pictures Corporation. All Rights
Reserved. This script is not for publication or
reproduction. No one is authorized to dispose of same. If
lost or destroyed, please notify the Script Department.
                         FINAL DRAFT
                      FEBRUARY 16, 1993
          STAR TREK: "Frame of Mind" - 2/16/93 - CAST 
                        "Frame of Mind" 
                PICARD             ADMINISTRATOR
                RIKER              ATTENDANT
                DATA               DOCTOR
                BEVERLY            INMATE
                TROI               LIEUTENANT
                WOUNDED CREWPERSON 
                N.D. COM VOICE     
                  1 WOUNDED N.D. CREWMEMBER
                  N.D. CREWMEMBERS (AUDIENCE)
                  2 GUARDS
          STAR TREK: "Frame of Mind" - 2/16/93 - SETS 
                        "Frame of Mind" 
            INTERIORS                  EXTERIORS
            USS ENTERPRISE             USS ENTERPRISE
              READY ROOM
              RIKER'S QUARTERS
              TEN FORWARD
              ASYLUM CORRIDOR
              ASYLUM COMMON AREA
              ASYLUM CELL
            ALIEN LAB
  STAR TREK: "Frame of Mind" - 2/16/93 - PRONUNCIATION GUIDE 
                        "Frame of Mind" 
                      PRONUNCIATION GUIDE 
                 TILONUS         tie-LONE-us
                 MAVEK           MAY-vek
                 JAYA            YAI-ya
                 SUNA            SOON-ah
                 SYRUS           SYE-russ

Click this link to view the complete script in a TXT format