One of my friends had a gun for self-preservation. He pulled it out to scare the intruder, but the intruder grabbed the gun from him and broke his jaw with the butt. He was lucky the guy didn't shoot him with it.
Even if you have a gun, it can be used against you by an intruder. Thieves know where you hide things and will find them.