This has been asked a few times.
I prefer this solution:
https://developer.roblox.com/en-us/api-reference/property/UserInputService/MouseBehavior