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

How do i use a mouse click as a Keycode?

key = string.upper(key)
	if key == "MouseLeftClick" then -- i dont know what the name of the mouse click the key

1 comment

0

I don't think the mouse has keycodes. Correct me if I'm wrong.

1 answer

✓ Accepted answer

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)

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