Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to use Right Click?

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

Put in a local script in starterpack.

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

mouse.Button2Down:connect(function()
print("click")
end)

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

if key == "z" then

This discussion is preserved as it was. New answers, comments, and votes are closed.