Send a signal when a player clicks WITHOUT using GUIs or ClickDetectors

Hello!

Basically, I was just wondering how I could get when a player clicks. I’ve tried using UserInputService, but it doesn’t appear that it has a keycode for the left mouse button click. I also want to avoid using ClickDetectors and GUI objects.

Thanks in advance for the help!

You can use UserInputService, only that you need to track the type of the input.

UserInputService.InputBegan:Connect(function(input, engine_processed)
    if engine_processed then
        return
    end
    
    if input.UserInputType == Enum.UserInputType.MouseButton1 then
        -- stuff lol
    end
end)
2 Likes

Yeah, I was just about to write a reply because I just remembered that existed as you were typing, I feel like an idiot haha.

Thanks!