Help with doing specific things in specific rooms

How would I make it when the player goes into a specific room, the game ends?
Basically, how do you do something only in a specific room?

After going to the Pit of Despair: end the story.

Instead of jumping in The Room with the Rickety Floor: "The floor groans and explodes in a shower of splinters and rotting wood and you fall..."; now the player is in Bottom of Pit.

This could also be “After jumping…”

After jumping: land, respecting gravity;

Wade, you’ll need the proper syntax there. I’m not sure, but I think you’ll want to follow the gravity rulebook.

To land, respecting gravity: Say "You canna' defy the law of gravity!"

Comma options!

To land, respecting gravity:
    if respecting gravity:
        say "You fall heavily to the ground.";
        say "You float downwards, heedless of gravity."

Inform 7. Disrespecting gravity since 2006.

“Dissing” gravity, if you’re into that sort of lingo. Yo.

Thanks guys!
I still have a problem though, how would you make it so that if you exit a room and go to another room, you can’t go back to the last room you were in?

Instead of going to a visited room: say "No, you've already been there, remember?"

Is the code going to affect all rooms?

If you’re interested in one-way map connections rather than a rule that prevents returning to visited rooms: Inform usually makes two-way connections between rooms. If you say that the Hallway is north of the Foyer, then, absent any contradictory information, Inform will assume that the Foyer is south of the Hallway. To prevent this, you can explicitly say that a connection is one-way:

The Foyer is a room. “This is the foyer. The hallway is to the north.”

Hallway is north of the Foyer. “This is the hallway.”

Nowhere is south of the Hallway.
[/code]Check out §3.3. (One-way connections) in the manual for more on this.

That code is for all rooms. If you only want it to be certain ones you can name them explicitly instead of saying “room” in the preamble.

Another way:

[code]First Room is a room.

Second Room is a room. It is north from First Room.

South from Second Room is nothing.

That effectively removes the return map direction, which might be useful in some circumstances.