How to stop right click events from firing when dragging camera?

Many of you hold the right click button and move the mouse to move your camera.
My game has bind to the right click button being a heavy attack button.

Here’s the problem, any time I drag the camera around as usual, the heavy attack fires.
How do I only make the heavy attack fire when the right click button is pressed, not held?

I currently use mouse.button2up:function. Every function I used (button2down, userinputtype.Rightclick) do the same thing. Can anyone help?

You may have better luck using UserInputService. The InputBegan could be used to achieve the same result as the mouse thing. InputBegan is superior though, because it has an extra parameter, gameProcessedEvent. In your code, just check if it:

  1. Is the right input type (i.e. the Mouse 2 one), and
  2. Check that gameProcessedEvent is false.