1. On the part you want to hide, right click on it and click on event (this will add an event to the part)
2. In properties, right click on event (right clicking on some things will bring up a special menu for that property)
3. Select weapon class
4. Right click on "arguments"
5. Enter the class name of the weapon in "find"
6. Right click on "operator"
7. Select find simple if you wrote a partial weapon class name or equal if you want it to match exactly
If you want to make it have the opposite effect, tick the "invert" box in the event properties.
These steps might change. Maybe have a context menu instead of a whole new window for events and operators since they're only a few and you can only really select one.