Looking back now. I should have used waypoints for patrol but what I did was have the monster move around randomly.
The loop counter goes up on death.