--Flight priority--

core.spawn(function()
	while myHuman.Health > 0 do	
		
		if target and not engineRunning then
			takeOff()
		end
		
		if not dodgingObstacles.Value and not criticalAction then
			if target and combat.getMunition(munition) then
				combatFlight()
			elseif engineRunning then
				flyHome()
			end
		end
		
		wait(0.1)
	end
end)


