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

How do i use a mouse click as a Keycode?

Asked by 3 years ago
Edited 3 years ago
key = string.upper(key)
    if key == "MouseLeftClick" then -- i dont know what the name of the mouse click the key
0
I don't think the mouse has keycodes. Correct me if I'm wrong. TypicallyPacific 61 — 3y

1 answer

Log in to vote
0
Answered by
Subsz 366 Moderation Voter
3 years ago

Hey there, to detect input use UserInputService, and to detect LeftClick through that, heres how u do it :

local userInputService = game:GetService('UserInputService')

userInputService.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then

end
end)
Ad

Answer this question