[[quoteright:260:https://static.tvtropes.org/pmwiki/pub/images/st_spectre_of_the_gun_6910275_f260.jpg]]
[[caption-width-right:260:This one's a bit different.]]

'''Original air date:''' October 25, 1968

The ''Enterprise'' has been sent to make contact with the reclusive Melkotians. As it approaches their planet, a glowing object intercepts the ship and a [[PowerEchoes booming voice]] warns the crew to go no further. Kirk reminds Spock that they were given "very clear" orders to establish contact with the Melkotians "at all costs", and decides to press on.

The disembodied brain with GlowingEyes is not happy about being disobeyed, so he sends Kirk, Spock, Bones, Scotty and Chekov to TheWildWest. Or at least, TheThemeParkVersion. It looks like it's made of tossed away scraps from a [[TheWestern Western film.]] [[PropRecycling (It probably was.)]] The buildings are little more than facades. In the saloon, there are no walls, yet a clock and a G-rated version of Ingres' ''La Art/GrandeOdalisque'' are suspended where walls should be. Ed TheBartender, Johnny TheSheriff and Sylvia the SoiledDove all seem very real, though. Kirk and the others find that their phasers are now old-fashioned six-shooters! What's more, they come to find this isn't just any old west town. They're in Tombstone, Arizona and the date is October 26, 1881. And everyone seems convinced that Kirk and crew are the Clanton gang and they have a date this afternoon at 5 at the O.K. Corral with the Earps.

How can they avoid this date? If they can't, will they survive? And does Chekov stand a chance of getting laid?
----
!!Spectre of the Tropes:

* ActorAllusion: This was Creator/DeForestKelley's third trip to the OK Corral; he played Morgan Earp in the 1957 film ''Film/GunfightAtTheOKCorral'', as well as Ike Clanton in the educational TV show ''You Are There''.
* AnyoneCanDie: Played with. At first, Bones points out that yes, obviously, people in this seemingly fictional setting really can die. Just when the viewer is thinking "Yeah, anyone but the ''Enterprise'' crew central cast!" Chekov dies defending Sylvia from the unwanted attentions of Morgan Earp. Of course, this death is only temporary: luckily for him, the historical Billy Claiborne survived the gunfight.
* AsYouKnow: Both the Melkotians and the unfortunate landing party make very, ''very'' clear the location, the date, the identities forced on Kirk & Co., and the historical outcomes of the preceding.
* BeliefMakesYouStupid: Or at least gets you killed. (To be brought back on the whim of the Melkotians.) It's knowing that the guns, bullets and their wielders are all but shadows of learned memories, beings of no substance, that will save the day.
* CassandraTruth: Kirk trying to explain to everyone in Tombstone who he and the others really are. It's treated as an odd joke.
* CreepyMonotone: The Earps and Doc Holiday all speak this way, in contrast to the other spectres, who act and speak convincingly like genuine characters.
* CurbStompBattle: After the Earps and Holliday have emptied their guns at our heroes, it takes Kirk less than ten seconds to beat Wyatt Earp down, leaving him plainly frightened on the ground.
* DeathIsCheap: Justified in some sense since Chekov's death was caused by imaginary bullets.
* DramaticThunder: As the Earps and Doc Holliday walk to the O.K. Corral for the final gunfight, lightning flashes overhead and thunder rolls.
* FakeTown: At the end of the episode Enterprise landing party learns that the whole town is a telepathic illusion. This is {{foreshadowed}} during the episode by depicting the exteriors of buildings as facades and the interiors of buildings not having walls.
* {{Foreshadowing}}: Probably not intentional, but this is an early appearance of something resembling a Holodeck adventure. Could Melkotonian technology have influenced the development of the Holodeck?
* GenreDeconstruction: This episode pretty much deconstructs the western genre, with the message that the wild west was not at all heroic, but violent and barbaric (however, Kirk proves that humanity has outgrown these violent tendencies). (See also: HistoricalHeroUpgrade[=/=]HistoricalVillainUpgrade below) At the (expected) big shoot-out at the end, Kirk decides ''not'' to fight the Earps, and that's what makes them win the sympathy of the Melkotians.
* GilliganCut: It's almost 5 o'clock, but not to worry! Kirk determines that none of them will be at the corral! "We're not going to move from this spot!" One blurry camera move later, they're all standing in the corral. Notable in that, due to {{Sufficiently Advanced Alien}}s, this isn't just a story-telling convention: they are actually transported to the corral the moment Kirk finishes speaking.
* HistoricalDomainCharacter: The Earps, Doc Holiday...possibly everyone involved with the O.K. Corral shooting.
* HistoricalHeroUpgrade[=/=]HistoricalVillainUpgrade: Wyatt Earp and his gang are portrayed as complete sociopaths, while the Clantons are Robin Hood types rebelling against their tyranny. Even ''the sheriff'' is said to want the Earps dead! Even if you support the view that the two sides weren't as black and white as the newspapers said, it comes off as a bit much. It's at least partly explained by the fact that these are illusions designed to threaten Kirk and Co. rather than to preserve historical accuracy.
* HonorBeforeReason: Kirk insists that, no matter how desperate the situation gets, they cannot sink to the Earps' level. It ends up saving him and the others.
* HookerWithAHeartOfGold: Sylvia the saloon girl is madly in love with Billy/Chekov and just wants him to be safe so she can marry him. She doesn't care that he's a killer and cattle rustler! She doesn't want Billy to be a hero. Not even an AntiHero!
* HowIsThatEvenPossible: After Spock and [=McCoy=] create a batch of knock-out gas, they test it on Scotty. He inhales the stuff deeply, but it has no effect whatsoever, which is clearly impossible. This leads Spock toward the conclusion that there is something fundamentally wrong with the whole situation.
* IComeInPeace: Kirk says the line "We come in peace." but does not follow it with [[WeComeInPeaceShootToKill Shoot to kill]] as a certain novelty song would have you believe. He does, however, immediately pull a phaser on the alien he's talking to and states that he and his men will defend themselves (though the episode does end with Starfleet creating diplomatic relations with the Melkotians).
* ImNotAfraidOfYou: All attempts to stop the fight at the OK Corral don't work, until Spock realizes that the guns aren't real. They are real only because the men expect them to be real and, because they know this, the bullets go right through them.
* {{Leitmotif}}: A harmonica plays an "Old West" type theme in the final scene while the characters marvel how humanity overcame their desire for violence. And in the saloon we hear a tack piano playing a twisted version of "Buffalo Gals."
* LetMeAtHim: After Chekov is shot, Kirk keeps Scotty from attacking the shooter.
* LiquidCourage: Plan A is to knock the Earps out with a jury-rigged knock-out gas. Scotty agrees to be the guinea pig, but first he needs some whiskey to "kill the pain."
* MacGyvering: They manage to make a gas grenade. Bonus points for doing this in an environment that was an illusion created by hostile aliens and is not even finished in places.
* TheMainCharactersDoEverything: The navigator, the captain, first officer, chief medical officer, ''and'' chief engineer are trapped in a bad Wild West simulation. Who the hell is minding the store? At least nobody's [[VideoGame/TheOregonTrail dying of dysentery]].
* MilkingTheGiantCow: Kirk is angered at the death of Chekov, but he [[PunctuatedForEmphasis Just! Can't! Kill them!]]
* NewspaperDating: Captain Kirk finds a copy of the ''Tombstone Epitaph'' dated October 26th, 1881.
* NotHelpingYourCase: Kirk's trying to tell people that he's not a Clanton and comes in peace, but when Morgan punches him, he can't stop himself from fighting.
* OhCrap: Wyatt gets a quite satisfying one when his bullets have no effect.
* OminousFog: The Melkotian appears in one when Kirk and Co. beam down. Once more, Spock has to comment that the environmental climate should not induce fog.
* OOCIsSeriousBusiness: Spock makes a non-snark reference to the doctor's "ingenuity," causing [=McCoy=] (and probably at least half the audience) to do a double take.
* PoliceAreUseless: Sheriff Behan is not only happy to let the Earps and the Clantons kill each other off, he's insistent on not getting involved and urges Kirk to take care of the Earps for him.
* QuickDraw
** Kirk almost unintentionally initiates one the first time he sees one of the Earps in the saloon. Kirk rises out of his seat, looking at Earp out of curiosity. The gunman draws his coat back, revealing his gun. Spock strongly suggests to Kirk that he slowly sit back down without moving either hand.
** Echoed in the climactic gunfight. When Earp growls, "Draw!", Kirk fakes a move towards his gun, luring the Earps and Holliday into opening fire with their now-useless weapons.
* {{Railroading}}:
** The Melkotians intervene several times to stop our heroes going off-script, with a force field around the town to stop them just leaving and some tweaks to the laws of physics to stop them calling the ship or inventing their way out of trouble.
** The episode also features a meta-example of railroading, with Starfleet's order to establish contact "at all costs" preventing Kirk from just turning around and leaving when the Melkotians first tell them to go away. It's never explained why Starfleet was so insistent.
* ScrewDestiny: It appears that the gunfight will turn out exactly as it did in history -- Spock even says "history cannot be changed" -- until Chekov is shot. With some prompting from Spock, Kirk remembers that in the historical gunfight the man Chekov represented ''survived''. This means that they can change the outcome rather than just be led to slaughter.
* SecretTest: Revealed to be the Melkotians' real purpose in setting up the landing party to fight the Earps. Kirk and company pass the test by trying to avoid violence and, when that proves to be impossible, limiting themselves to non-lethal self-defense. As a result, the Melkotians greet them in friendship.
* ShoutOut: Taos Lightning is a quite real brand of whiskey characterized by its spicy taste. When it was first distilled in the 1820s, the mountain men who liked it didn't really call it Taos Lightning, just Taos Whiskey or ''aquardiente''.
* [[SignificantReferenceDate Significant Air Date]]: The episode originally aired October 25, 1968, one day before the gunfight's anniversary.
* SomeKindOfForceField: Is keeping Kirk and co. from [[DoorJam leaving Tombstone.]]
* SpaceWestern: At any rate, a CowboyEpisode on a series of spacefaring folk.
* {{Sufficiently Advanced Alien}}s: The Melkotians are true telepaths -- that is, they can project any sensory illusion as well as do Windows file management on your head -- and {{Reality Warper}}s of near limitless power in their own territory, and [[CantArgueWithElves too aloof to regard humans as more than pests or amusements.]] Like most examples of this Trope, the only way the protagonists can hope to survive is impress and convince them enough to resolve the issue peacefully.
* TeamPowerWalk: The Earps and Doc Holliday walk together shoulder-to-shoulder to the O.K. Corral to fight the "Clanton Gang" (Kirk, Spock, [=McCoy=], Scott and Chekov).
* ThouShaltNotKill: Kirk refuses to kill Wyatt once he has him at his mercy, even though he killed Chekov. [[HumansAreSpecial This impresses the aliens.]]
* TranslatorMicrobes: Kirk points out how odd it is that this alien being who has had no previous contact with any outside force knows English. Spock, Chekov and Uhura report hearing the message in their respective native languages. Spock concludes that the Melkotians are advanced telepaths. Specifically, he says they are ''true'' telepaths, not only able to read minds and broadcast in this way but to control what the landing party perceives and make the complex illusion seem completely real.
* VillainousValor: Doc Holliday could easily have shot [=McCoy=] dead as soon as he walked out the door for "stealing" his stuff, but for some reason doesn't.
* YourMindMakesItReal: Summed up perfectly by Spock. Spock realizes the whole experience is an illusion that is only as real as their minds accept it to be, but, as [=McCoy=] says, only someone as emotionless as a Vulcan could have the [[HeroicWillpower iron-hard certainty]] required — even a shadow of doubt would be lethal. Spock mindmelds with the others to make them just as sure of the illusion as he is, [[ClapYourHandsIfYouBelieve making them invulnerable to it.]]
----