If the error was with the script it just wouldnt work, your wouldnt get any errors.
Make sure you have the npc in sql in the npc table, and the script in npc.def.
Or merchant in sql and script in merchant.def.
If you have your npc in merchant table, and the script in npc.def, you will...