Don't take a handgun since possession laws can land you in jail. Instead, take a 12 gauge pump shotgun. You don't need a license. Everyone, especially a potential crook, knows what a pump shotgun sounds like when a round is loaded. So, the sound will scare him away and you won't have to expose yourself or fire a "warning shot". That way, you won't have to explain anything to the police and you'll be safe.
In over 20 years of RVing, we've only been "approached" once and he moved on once we told him we didn't have what he wanted. (I think he wanted a sandwich, or something like that.) I spoke thru the windows, and not at the front door. I kept out of sight. This was in the parking lot of a closed Wal-Mart. We've never had any other incidents. (This may sound cruel, but he didn't appear to be interested in getting a sandwich, but rather in casing our precautions. It was around midnight or a little later.)