ifItemInHand is an output even that works with the Variable events.
Upon triggering (such as onActivate), it will either return true or false.
So, set up something like this:
onActivate -> Self -> ifItemInHand (Gun)
VariableTrue -> Client -> Centerprint ("Ah, you brought me the gun! Thanks!")
VariableTrue -> Player -> removeItem (Gun)
VariableTrue -> Player -> setItem (None)
VariableFalse -> Client -> Centerprint ("Hey there, could you bring me a gun?")
The reason you should use removeItem and setItem to none is because removeItem handles the inventory, and setItem handles the hand.
(Come to think of it, I don't know why I didn't add a setItem none feature in removeItem when I made it... I might update that later.)