How would i detect who the mouse is on when a key is pressed?

So i want to detect on when i press “CRTL” the script detects on who my mouse is pointed on, How would i do that?

Mouse.KeyDown:Connect(function(key)
         if key:byte() == 50 then
               -- detect on who's character my mouse is on here
         end
end)

Any help is helpfull

NEVERMIND, I found out

What you do is Mouse.Target and it will detect on what your mouse is on, Sorry!

1 Like

You shouldn’t be using KeyDown anyway, it’s deprecated. You should be using either UserInputService or ContextActionService if you are looking to create keybinded actions.

4 Likes

Well i’m learning on how userinputservice works but im kinda lazy