Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Key Code for Right Mouse Button?

Asked by
u_g 90
10 years ago

How would you make it so that something is done when the right mouse button is clicked? [Also, it has to be compatible with this:

if key == "(right mouse button)"  then
-- code
end

1 answer

Log in to vote
2
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
10 years ago

Well, It's MouseButton2Down. So...

mouse = game.Players.LocalMouse:GetMouse()
mouse.Button2Down:connect(function()
    print("Right click!")
end)
0
Thanks. u_g 90 — 10y
0
Thank me by Accepting this answer! Shawnyg 4330 — 10y
Ad

Answer this question