(In a local script)
game:GetService("UserInputService").InputBegan:connect(function(input) if not input.UserInputType== Enum.UserInputType.MouseButton1 or Enum.UserInputType.MouseButton2 or Enum.UserInputType.MouseButton3 then --Do my other code here end
You only compare the first Enum and not the others, you need to also compare the other Enums.
You might also want to make variables on the enums.
local m1, m2, m3 = Enum.UserInputType.MouseButton1, Enum.UserInputType.MouseButton2, Enum.UserInputType.MouseButton3 game:GetService("UserInputService").InputBegan:connect(function(inputObj) -- compare each mouse inout if inputObj.UserInputType == m1 or inputObj.UserInputType == m2 or inputObj.UserInputType == m3 then return end -- return out of the function if one is found -- code end)
I hope this helps.