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

How to use Right Click?

Asked by 10 years ago

So as I am making a Zoom Script for a Weapon I was wondering how to make Right Click the button to zoom? I got it all down but right now it is ~~~~~~~~~~~~~~~~~ if key == "z" then ~~~~~~~~~~~~~~~~~ If I wanted to turn that into right click rather then Z, how would I do that? Would I put Rmb? Or maybe RightC? What do I put to make it Right click rather then the Z key. Help is very much appreciated.

2 answers

Log in to vote
2
Answered by 10 years ago

Put in a local script in starterpack.

local mouse = game.Players.LocalPlayer:GetMouse(); -- get mouse

mouse.Button2Down:connect(function()
print("click")
end)
Ad
Log in to vote
-3
Answered by 10 years ago

I apologize for the code not working. It was supposed to be.

if key == "z" then

Answer this question