You may want to look through Example Mod.
By NPC, do you mean a Town NPC or a regular NPC (such as slimes)?
I assume it's a Town NPC. In that case, I cannot help, I've haven't made a Town NPC without having an error yet (though, now that I understand more about C#, and have Visual Studio, I...