There isn't any way to tell if the middle mouse button is down, only the left/right buttons. Is there any way to tell if it is down? I tried InputBegan, but that returned Enum.KeyCode.Unknown. Maybe there is a different event that returns the middle mouse button status?
✓ ANSWER ACCEPTED
How to Tell if the Middle Mouse Button is Down?
2 answers
✓ Accepted answer
local player = game:GetService("Players").LocalPlayer
local userinput = game:GetService("UserInputService")
userinput.InputBegan:Connect(function(input, bool)
if bool then return end
local input = input.UserInputType.Name
if input == "MouseButton3" then
print("MouseButton3 is being held down")
end
end)
You cant. It is actually refered to as
WheelBackward
or
WheelFoward
eg.
if WheelBackward:connect(function()
-- script goes here
end
3 comments
0
No.
0
You will get an error on that last code snippet.
0
Thanks for the answer, but it's not what I am looking for. I am looking to detect it when the middle mouse button is clicked, not scrolled.
This discussion is preserved as it was. New answers, comments, and votes are closed.

17 comments
can you refrain from copying me
lol I can't tell if you're joking or not, for one I started writing this before your answer came, and two my answer doesn't resemble your answer at all
highly doubt it
I didn't ask for your opinion, it doesn't take a rocket scientist to see the difference
what was the point of answering an already answer accepted question tho
what don't you understand about writing my answer before yours came out
Vulkarin is right.
heh not my fault you took a long time. also everyone says that
don't let your arrogance blind you
i'm not arrogant lol. i'm just saying you copied my idea
your script doesn't even work, lol
it does though? the only difference between mine and yours is you defined the variables. OP will obviously have done that. and a different UserInputType maybe but it's the same thing
needs the MouseButton3 input type which is literally what my whole thing is, and yet another reason why mine is not even remotely a copy, thanks
facepalm if it didn't work my answer wouldn't have been accepted lol. whose the smartie now
not really it's just a fact. it's like saying i'm arrogant if my answer on a maths question that asked what 1 + 1 was is 2.
it's like saying your smart when the teacher accepts your answer of 1+1 is 3 lol