Build Armor

So I have a Build To Kill server in gmod and I have been trying to make a code that gives the player godmode if they have the physgun or toolgun out, and i was wondering if any one could make a simple code to do that.

-Thanks