Merged scripts from Erik. Still need pathfinding and levels to be resolved from Erik.