INT. Mclaren's pub

BARNEY, ROBIN, LILY, and MARSHALL are sitting at their booth in the pub when a distraught TED enters. He sits down at the chair at the head of the table. The CAST shift their attention to him.

Lily

What's wrong Ted?

TED

(irritated)

I swear, this always happens - I was just at a department meeting at the college, and they had this professor from MIT there as a guest speaker. She was beautiful, intelligent, and I did not even think to ask her out!

Barney

Tisk, tisk, Ted. You have to be smart enough to take advantage of opportunities when they present themselves - seize the moment! Carpe diem, that's what the French say.

LILY

Carpe diem is Latin, not French.

BARNEY

(nonchalantly)

Whatever.

BARNEY firmly takes the final swig of his beverage. He takes a pair of scholarly eye-glasses out of his coat's inside pocket and puts them on.

BARNEY

Take me for example. I recently learned that there is a new, sexy librarian at the public library, so I am on my way there now to have her help brush up my Dewey decimal system.

BARNEY raises his hand and high-fives the still distraught TED.

Robin

You're disgusting.

BARNEY

(offended)

I'm disgusting? Just because I want to try to make an honest connection with another human being? Jeez Scherbatsky, grow a heart.

While everyone knows that BARNEY is just kidding, the chance that this could be about BARNEY and ROBIN's recent break-up makes an uncomfortable silence. BARNEY is unfazed.

BARNEY

Marshall, can I borrow your library card?

Marshall

Sure.

MARSHALL takes out his wallet and hands BARNEY a laminated card.

TED

You can't just use someone else's library card. It has his name on it.

BARNEY

Oh, please, this is just for posterity.

BARNEY points to his face.

BARNEY

(confidentially)

This is the only card I'll need to check out what I want.

BARNEY slides the card into his coat pocket.

BARNEY

Oh, by the way, Marshall, when do you want my guys to drop off that lion tapestry for your living room?

LILY shoots a look over at a timid MARSHALL.

MARSHALL

Actually Barney, I don't think Lily and I will have room for it.

BARNEY

(surprised)

What!? I ordered it specifically for you from that totally legal tapestry dealer in Bangkok!

LILY

(sweetly)

While we appreciate the gesture, my aunt gave us some paintings of medieval cherubs that we're going to hang up instead.

BARNEY

(devastated)

But Marshall, we were just talking about how much you loved lion tapestries!

MARSHALL looks and shrugs at BARNEY silently, displaying how powerless he is in the situation.

BARNEY

Fine, I see how it is!

BARNEY stands up and adjusts his non-necessary glasses defiantly.

BARNEY

(boldly)

If anyone needs me, I'll be at the library!

The CAST watch as BARNEY storms out of the pub. Only a moment later, he quickly pokes his head back in through the door.

BARNEY

(humbled)

Could someone maybe just point me in the right direction?

TED, ROBIN, LILY, and MARSHALL shake their heads and chuckle at BARNEY's ignorance.

CUT TO:

HOW I MET YOUR MOTHER OPENING TITLE SEQUENCE

cut to:

INT. PUBLIC LIBRARY

BARNEY enters the library and looks around in splendor at the many shelves of books. BARNEY comments on his surroundings in his mind.

BARNEY (VO)

This place is huge.

He passes a janitor mopping the floor in his travels. While walking, he sets his eyes on the pretty, brunette LIBRARIAN, who is behind the main desk sorting books.

BARNEY (VO)

She's even hotter than I imagined!

BARNEY prepares to approach her, but remembers that he is posing as a library regular with his glasses.

BARNEY (VO)

I need a book!

Quickly, BARNEY grabs a random green book on the shelf near him. He flips through it swiftly.

BARNEY (VO)

Eh, wizards, flying monkeys, Kansas - this'll do.

BARNEY looks up to see a large group of school children approaching the LIBRARIAN at the desk. They each have several books in their hands. BARNEY is alarmed.

BARNEY (VO)

Those damn kids are going to take forever if I don't get there first!

BARNEY runs from his spot towards the desk. As he is running, he slips where the janitor is mopping the floor, and falls on his back, hitting his head.

CUT TO BLACK

ext. Munchkin land

An unconscious BARNEY lays in the middle of a magical town. He is wearing a blue and white checkered suit without a tie. A group of little MUNCHKINS are gathered around him, staring inquisitively at him.

Munchkin #1

Me thinks he's dead!

MUNCHKIN #2

At least he didn't drop a house on anyone!

BARNEY begins to stir and moan on the ground.

MUNCHKIN #3

Good golly! He's alive!

BARNEY groggily comes about and then snaps awake when he sees the MUNCHKINS surrounding him. The MUNCHKINS all chatter with excitement.

BARNEY

Get away from me, you freaky little kids! I'm still going to get to the desk -

BARNEY pushes his way through the little crowd, still thinking he's in the library. Once he breaks through, his sense of victory is quickly replaced with confusion. He looks around Munchkinland amazed.

BARNEY

(baffled)

- first.

The MUNCHKINS are intrigued by BARNEY's behavior. One of them moves to the front of the group and addresses BARNEY.

MUNCHKIN #1

Where is this desk that you speak of, oh great giant?

BARNEY looks at the colorful MUNCHKINS confused. He then looks down, mystified by his strange checkered suit. Once he is done admiring his suit, he looks stoically off into the distance .

BARNEY

Suit, I've got a feeling we're not in New York anymore.

The MUNCHKINS stand there silently.

MUNCHKIN #2

What's a New York?

BARNEY kneels down to the level of MUNCHKIN #2.

BARNEY

Listen little towns person, I'm not supposed to be here. Is there anyone here who could help me get back home?

MUNCHKIN #2

(nervous)

How about her?

MUNCHKIN #2 points behind BARNEY. BARNEY stands up and turns around to see the beautiful LIBRARIAN WITCH dressed in a big pink gown with a crown and wand, laughing with a group of MUNCHKINS off in the distance. BARNEY smiles.

BARNEY

(confidentially)

Forget going home! Little townspeople, I, Barney Stinson, am going to sleep with that good witch!

The MUNCHKINS all look at each other disturbed. BARNEY runs over towards the LIBRARIAN WITCH. Before he reaches her, thunder crashes and it grows darker.

LILY WITCH (VO)

Muahahahaha!

BARNEY stops in his path. A cloud of colored smoke appears, revealing LILY WITCH, who looks like LILY, only with green skin, black hair, and scary witch clothes. The MUNCHKINS are frightened by her.

LILY WITCH

(in a stereotypical shrill witch voice)

Not so fast, my pretty!

MUNCHKIN #3

Be careful giant checkered man, that's the wicked witch!

BARNEY

(bravely)

Step aside, wicked witch.

LILY WITCH

Oh, you want me to step aside so you can go sleep with the good witch over there?

(gestures to LIBRARIAN WITCH behind her)

But tell me, Barney, how do you plan to seduce her WITHOUT A TIE?

Alarmed, BARNEY looks down in horror at his lack of a tie. He looks back up and sees LILY WITCH holding a shiny red necktie in her hand.

LILY WITCH

Muhaha, you'll need this here ruby tie if you ever want to get with her. And guess what, it's mine and I'm not going to let you have it, muhahah!

Thunder crashes again, and LILY WITCH disappears behind another cloud of colorful smoke. The day lightens up again. BARNEY quickly turns to the MUNCHKINS.

BARNEY

(hurried)

Where did she take that tie?

MUNCHKIN #1

(confidentially)

To her evil lair in the Emerald City! You must go there and retrieve the ruby tie if you ever hope to...uh..

(embarrassed)

sleep with the good witch?

BARNEY

Quick, how do I get to the Emerald City?

MUNCHKIN #2

You follow the yellow brick road of course!

BARNEY looks back at what clearly appears to be the yellow brick road. He quickly turns back to the MUNCHKINS.

BARNEY

(hurried)

Which road is that?

MUNCHKIN #1

(confused)

It's the bright yellow one?

BARNEY is not receptive at all to the descriptions of the road - the MUNCHKIN may as well be speaking Greek.

MUNCHKIN #1

It's the only road leaving the town?

BARNEY is still not receptive - only confused.

MUNCHKIN #1

You know what, I'll just show you. Follow me.

MUNCHKIN #1 takes BARNEY's hand and leads him over to the beginning of the yellow brick road.

cross fade

Ext. Yellow brick road

BARNEY is casually walking down the yellow brick road, admiring the nature around him. Unknowingly, he passes TED SCARECROW(a scarecrow that looks like TED), who is propped up on a stake.

TED scarecrow

(desperately)

Will you go out with me!?

BARNEY stops and looks around.

BARNEY

Who said that?

TED SCARECROW

(disappointed)

Oh, shucks, you're a dude.

BARNEY

Sorry straw man, the B-Dog doesn't roll like that.

TED SCARECROW

No, no, I'm not gay. I'm just terrible at recognizing opportunities to hit on girls because I'm stuck up here all day.

BARNEY is pensive as he looks at the sadden scarecrow.

BARNEY

Tell you what. I'll get you down from up there, and you can come with me to the Emerald City. I'll give you some pointers along the way. And when we find the good witch, she could even give you some intelligence.

TED SCARECROW

(comically excited)

Wow, that would be great! You're so much cooler than me.

BARNEY

I know.

BARNEY helps TED SCARECROW down off of the stake. The two continue walking down the yellow brick road.

BARNEY

So before we start, do you have any goals you want to achieve with the ladies? Bag a cougar? A dancer? A three-way?

TED SCARECROW

(bashful)

Well, I'm kind of looking for the one.

CUT TO:

Int. Living room

Two bored SCARECROW TEENAGERS are sitting on a large couch, looking into the camera.

Ted scarecrow (vo)

And that kids is how I met your Uncle Barney.

cut to:

EXT. YELLOW BRICK ROAD

BARNEY

(rolls his eyes)

Oh, boy.

As the two are walking, they past a stiff metal figure, ROBIN TIN (a tin person who looks like ROBIN) frozen in place.

ROBIN TIN

(through rusted-shut mouth)

mmmmyyyrppp aaaahh!

BARNEY and TED SCARECROW stop and see ROBIN TIN.

TED SCARECROW

Look! It's a woman made of tin cans! And she's trying to say something!

BARNEY moves close to frozen ROBIN TIN.

ROBIN TIN

(through rusted-shut mouth)

mmmyyyrppp ahhhh!

BARNEY ponders the sound and looks around the area. He sees a bottle of maple syrup on a near-by stump. Excited, he retrieves the bottle and returns to ROBIN TIN's side.

BARNEY

I think she's Canadian - she's saying 'Syrup, eh!'

BARNEY drizzles the syrup on ROBIN TIN, who slowly creaks back to life.

ROBIN TIN

Oh, thank you so much. You have no idea how long I've been -

TED SCARECROW

(desperately)

Will you go out with me!?

ROBIN TIN

(disturbed)

Uh, no.

TED SCARECROW is embarrassed.

BARNEY

Ouch, that was cold and heartless...She is definitely Canadian.

ROBIN TIN

(defensive)

I'm not cold and heartless!

BARNEY and TED SCARECROW look at her questioningly.

ROBIN TIN

(calmed down)

OK, so maybe I am a little cold. And it's not my fault I don't have a heart - we Canadians literally aren't built with them.

BARNEY

You're welcome to come with us to the Emerald City. I'm going to sleep with a good witch there who could easily give you heart. I mean, she'll already be giving me head.

TED SCARECROW & ROBIN TIN

(very appalled)

WHOA!

BARNEY

(smirks)

Sorry. I forgot this was a kids book.

The three continue on down the yellow brick road. Babies giggling and wings flapping are heard off screen. The three look up at the sky.

BARNEY

Look! Flying medieval cherubs! We must be getting close!

As the three quicken their pace, the babies and wings grow louder. MARSHALL LION (a lion that looks like MARSHALL)comes bounding out of the woods. BARNEY, TED SCARECROW, and ROBIN TIN are frightened.

ROBIN TIN

It's a lion!

MARSHALL LION

(scared)

You've got to save me from the witch's cherubs!

BARNEY

You know the wicked witch?

MARSHALL LION

Know her? I'm married to her!

ROBIN TIN

If you're a lion, why are you so afraid of cherubs? They're just babies with wings.

MARSHALL LION

(paranoid)

OR they're birds with baby bodies! Ever think of that!? Huh!?

BARNEY, TED SCARECROW, and ROBIN TIN look at MARSHALL LION skeptically.

MARSHALL LION

My wife likes them around our apartment, but I don't have the courage to tell her that they scare the living Hell out of me.

BARNEY grabs MARSHALL LION by the arm and begins leading him down the road. TED SCARECROW and ROBIN TIN follow suit.

BARNEY

We're actually going to pay a visit to your wife right now, and you're going to come with us, so you can confront her and tell her how you really feel about the cherubs once and for all.

MARSHALL LION

But her aunt gave them to her!

BARNEY

(overly dismissive)

I don't care!

The ragtag crew continues down the road and exits the shot, led by BARNEY confidentially dragging MARSHALL LION.

fade to black

INT. Emerald City Apartment

LILY WITCH is stirring a cauldron in the middle of the dark, creepy apartment. The ruby tie is sitting on an illuminated pedestal behind kicks open the front door, and he, TED SCARECROW, ROBIN TIN, and MARSHALL LION enter the room.

BARNEY

Give me that tie, wicked witch!

LILY WITCH

(still in shrill witch voice)

Never! Muhahahaha!

Thunder crashes as wind blows LILY WITCH's hair menacingly. She begins to glow ominously.

BARNEY

Quick, lion! Confront her!

MARSHALL LION

(cowardly)

But she scares me!

BARNEY, TED SCARECROW, & ROBIN TIN

GO!

MARSHALL LION timidly approaches the scary glowing LILY WITCH.

MARSHALL LION

(politely)

Hi, honey. I was wondering if I could talk to you for a second?

LILY WITCH

(scary demonic voice)

WHAT?

MARSHALL LION

Well, it's just that we're a couple, and couples need to compromise, and as a compromise, I would really appreciate it if we could maybe get rid of the medieval cherubs?

LILY WITCH

(demonic voice)

YOU KNOW MY AUNT GAVE THEM TO ME!

MARSHALL LION

(pathetically)

BUT THEY SCARE ME!

BARNEY, TED SCARECROW, and ROBIN TIN are watching this train-wreck from a distance.

BARNEY

(nervously)

He's failing - HE'S FAILING!

TED SCARECROW looks around the room for a way to help MARSHALL LION. He sees a bucket of water in the corner, and runs over to it. LILY WITCH continues roaring as MARSHALL LION whimpers before her. TED SCARECROW thinks for a moment, and then decides to act in the moment and splash LILY WITCH with the water. LILY WITCH is soaked with the water.

LILY WITCH

(normal LILY voice)

Ahh! Oh my God!

MARSHALL LION

So can we get rid off the cherubs?

LILY WITCH

(frustrated and wet)

Do whatever you want.

LILY WITCH storms off to dry herself off while BARNEY runs across the room to the ruby tie. Excited, he ties the tie around his neck. There is a bright glow, and LIBRARIAN WITCH appears in the apartment. She approaches BARNEY sensuously.

Librarian WITCH

Barney...

BARNEY

Sexy librarian witch...

LIBRARIAN WITCH and BARNEY move in close to each other. LIBRARIAN WITCH strokes the ruby tie seductively.

BARNEY

I came all this way and defeated the wicked witch just to get this for you.

LIBRARIAN WITCH

That was very sweet of you Barney, but you already had what you needed to sleep with me the whole time.

BARNEY

Huh?

LIBRARIAN WITCH taps on the bulge in BARNEY's pants.

BARNEY

(smirks)

Oh. Right...

LIBRARIAN WITCH moves in to kiss BARNEY on the lips. BARNEY goes in for it, but then sees TED SCARECROW, ROBIN TIN, and MARSHALL LION standing awkwardly in the distance and stops.

BARNEY

Actually, before we do this - I told my friends you could give them what they wanted too.

LIBRARIAN WITCH turns around to look at the others, and turns back to BARNEY.

LIBRARIAN WITCH

(sweetly)

But honey, they already got what they wanted.

BARNEY looks at TED SCARECROW who is holding the empty bucket of water and smiling proudly because he knows that he had the intelligence to act in the moment. Then, they ALL look up to listen to LILY WITCH shooing away the chattering cherubs off of the roof.

LILY WITCH (VO)

I don't care, you need to leave! I don't get it either! Don't make me use this broom!

MARSHALL LION smiles proudly because he knows he had the courage to confront his controlling wife. BARNEY looks at ROBIN TIN, who is upset because she never got her heart. BARNEY sees this and is concerned.

BARNEY

But, sexy librarian witch, the Canadian never got her heart.

LIBRARIAN WITCH looks concerned and pensively at ROBIN TIN. She turns back to BARNEY.

LIBRARIAN WITCH

(flatly)

Even I can't perform miracles.

ROBIN TIN

(deeply offended)

Thanks a lot, bitch!

ROBIN TIN storms angrily out of the room. BARNEY and LIBRARIAN WITCH shrug and then begins passionately making out.

Slow fade out

INT. BARNEY's bedroom

Slow fade in

BARNEY is in his bed wearing the suit from the library. His eyes are closed and he is passionately making out with the air before him, as TED, ROBIN, LILY, and MARSHALL watch him disturbed.

TED

Barney.

BARNEY continues kissing the air.

TED

BARNEY!

BARNEY startles awake and is immediately disappointed when he realizes that he is not actually making out with the LIBRARIAN WITCH. He sees his friends gathered around him and has a realization.

BARNEY

(softly)

It was all a dream...

MARSHALL

What was that, Barney?

BARNEY

I had this crazy dream, and you were there!

(points at MARSHALL)

And you!

(points at LILY)

And you!

(points at TED)

And you!

(points at ROBIN)

BARNEY's friends laugh at the absurdity of this prospect.

LILY

(to BARNEY)

You had a nasty spill at the library and hit your head.

BARNEY

But how did I get back here?

TED

A good Samaritan at the library saw you fall, found your cell phone, and called your emergency contact immediately.

BARNEY

Who was listed as my emergency contact?

ROBIN

(quietly)

Me.

BARNEY and ROBIN share a moment over the fact that BARNEY still has ROBIN listed as his emergency contact even though they recently broke-up.

TED

We rushed to the library as soon as Robin got the call. When we got there, you were unconscious and rambling something about miniature townspeople and a ruby tie.

There is a brief silence.

MARSHALL

We thought we lost you, man.

After hearing this, silence lingers in the room and ROBIN grabs BARNEY's hand. Turns out she still does have a heart for BARNEY after all.

BARNEY

Wait, if you thought I was seriously injured, why didn't you take me to a hospital?

BARNEY's friends look at each other, desperately scrambling for words. BARNEY understands their silence to mean that none of them were smart and/or concerned enough to think of that.

BARNEY

Alright, whatever, forget I asked. Did you at least thank the good Samaritan from the library for me?

BARNEY's friends look at TED.

LILY

Actually, Ted was thinking on his feet and asked her to come here so you could thank her yourself.

TED smiles proudly, while BARNEY is confused.

BARNEY

Wait. 'Her?'

At that moment, the LIBRARIAN enters the bedroom and approaches BARNEY's bedside. BARNEY is surprised and elated.

BARNEY

I don't know how to thank you.

LIBRARIAN

(seductively)

I can think of one way.

The LIBRARIAN mounts BARNEY on his bed, and begins kissing his neck. BARNEY enjoys it, but is a little confused. BARNEY's friends are still standing watching this unfold. All of them seem to admire BARNEY in this moment.

BARNEY

(chuckles uncomfortably)

Don't get me wrong, this is awesome, but right now? My friends are still in the room.

LIBRARIAN

(flatly)

You're still dreaming. Shut up and do me.

BARNEY has a moment of revelation.

LILY

She's right - that's why I have fourteen fingers!

LILY proudly reveals her freakish amount of fingers on each hand to BARNEY.

TED

And why I'm wearing these stripper boots!

TED raises a leg from behind the bed, revealing to BARNEY knee-high bright pink heels. BARNEY ponders all of this for a moment.

BARNEY

(thoughtfully)

So before I was having sex in a dream in a dream, and now I'm just having sex in a dream. It's like... sex Inception... IN-SEX-TION!

LIBRARIAN

(unbuckling BARNEY's pants)

Sure, whatever, now let's get these pants off...

BARNEY

(boldly)

I, Barney Stinson, have finally discovered Insextion! THIS IS GOING TO BE LEGEN-wait for it...

Jump Cut to:

INT. PUBLIC LIBRARY

In reality, BARNEY is still lying with his eyes closed on the library floor where he first fell. He still has the fake glasses on, and the open green book is lying on his chest. The real LIBRARIAN and the group of children are standing around watching him.

BARNEY

(eyes still closed)

- DARY!

BARNEY proceeds to passionately make out with the air like he was originally doing in his dream. The kids are grossed out and the LIBRARIAN is disgusted.

LIBRARIAN

(frustrated)

Can someone please call the cops?

FADE to black

cut to:

HOW I MET YOUR MOTHER END CREDITS

End