porting GunSelector.cs
commented out player-control code (not suitable for NPC control)