Matt.
You must first understand how autofocus works.
In dim light, Pentax cameras struggle at the best of times to lock focus.
Given those conditions, the camera cannot find anything with enough contrast to focus on, so it constantly searches and finally gives up with a flashing hexagon in the viewfinder, indicating a failed focus attempt.
So what to do? Here's where manual focus comes in, you just set it to infinity distance, set a small enough aperture to capture what you need and fire away.
Metering under these conditions provides another challenge, but one thing at a time.