EgoMoose gravity controller for NPCs

Hello there! I am trying to make EgoMoose’s gravity controller for NPCs. I’ve tried to port it for NPCs but it wont work. Any idea how to do something like this?