One of the perennially difficult parts of a roleplaying campaign is explaining the sudden appearance of new characters mid-adventure, when they are needed for the metagame reason that the player's previous character has died, and the player needs something to do.
This can get particularly problematic in confined environments, or other places where even coming across anyone else (who's not out to kill you) is unlikely in the extreme, like deep in a dungeon.
In cases such as this, it pays to have a few handy NPCs floating around that the bereft player can take over until such time as a more suitable replacement can be logically integrated into the adventure.
Transcript
Qui-Gon: {dead} I think I'll build a ninja for my new character.
GM: Um. It'd be a bit awkward introducing a... new character at this point in the adventure. It'll be better if you take over an NPC.
Qui-Gon: Cool. Captain Tarpit!
GM: Er... no.
Qui-Gon: Senator Puppeteen then.
GM: I don't think so. Let me see who's the best choice... Oh.
Qui-Gon: What?
GM: Padmé.
Qui-Gon: Who?
GM: The Queen.
Qui-Gon: Ooooh, yeah! The ruler of an entire planet! Awesome! "Off with their heads!"
Qui-Gon: Obi-Wan, give Padmé my stuff.
Obi-Wan: Okay, let's see. Underwater oxygen extraction apparatus, 50 feet of rope, grappling hook. Check.
Qui-Gon: And my laser sword.
Obi-Wan: Um, I'd better hang on to that one.