Anyone have any experience with custom npcs?

I am trying to replicate this way of doing it, but I am having trouble getting the TeleportTo function to work within an NPC, how did you set yours up? I also have wanted to give my NPC a roam state and a chase state but can never seem to get it to work.