This problem is caused when the map the NPC is associated with doesn't have metadata.
To break this down further, if you are calling the following script:
Phone.add(1, "Professor Oak", 100)
Then in your map_metadata.txt PBS file, you'll need something like the following...