Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

What is the equivalent of :IsKeyDown for a mouse button?

Asked by 3 days ago

Im trying to do something that requires me to find out if a mouse key is being pressed

0
Button1Down (Left) & Button2Down (Right) are both RBXScriptSignals of the Mouse Object. Feahren 5485 — 3d
0
And how do i use this info 0-0 banane1man 2 — 3d
0
What exactly are you trying to look for you didnt quite explain enough what are you trying to do? DuckyRobIox 180 — 3d
0
Get the players mouse and make a function NathanBlox_Studios 100 — 3d
0
You can find that on the Developer Wiki. Feahren 5485 — 3d

1 answer

Log in to vote
1
Answered by 3 days ago
Edited 3 days ago

You should make a script with a BoolValue to help!

For the Left mouse button:, see below:

local BoolValue = path.to.BoolValue -- Replace path.to.BoolValue with the path to the boolValue.
local Mouse = game:GetService("Players").LocalPlayer:GetMouse()
Mouse.Button1Down:Connect(function()
     BoolValue.Value = true
end)
Mouse.Button1Up:Connect(function()
     BoolValue.Value = false
end)

For the Right mouse button:, see below:

local BoolValue = path.to.BoolValue -- Replace path.to.BoolValue with the path to the boolValue.
local Mouse = game:GetService("Players").LocalPlayer:GetMouse()
Mouse.Button1Down:Connect(function()
     BoolValue.Value = true
end)
Mouse.Button1Up:Connect(function()
     BoolValue.Value = false
end)

Hope this helps! Metatable out

0
:0 Spiritlotus 121 — 2d
Ad

Answer this question