Detecting how the mouse moves

How would I do this?

I want detect how the mouse moves. For example, I want to check if the mouse moving seems natural or it seems like a robot. Thank you if you could help!

PS: I’m willing to script it myself. Just give me an example and if it’s possible.

Not a solution as this seems extremely difficult to work reliably since I’m assuming its for an anti-cheat, but you could try detecting if the mouse continuously moves to an exact position, or if it goes in a straight line at a constant fixed speed however you would do that, but it depends what it’s for, if you elaborate a bit more I might be able to help more.

1 Like

That seems kind of difficult to understand.

If your trying to get If the Mouse Movements then it exists a function for that.

local Mouse = game.Players.LocalPlayer:GetMouse()

Mouse.Move:Connect(function()
         -- [ print('It moved!'), and you can use for other stuff too
end)
1 Like

To detect the mousemovement:

local UIS = game:GetService("UserInputService")
UIS.InputChanged:Connect(function(input)
	if input.UserInputType == Enum.UserInputType.MouseMovement then
		print(input.Position)
	end
end)

Now find out how to make an anticheat with this.

1 Like

Yes, this for an anti bot, I was making an approach similar to re captcha, a bot doesn’t move a mouse like a human. Any idea how I detect if the movement is too precise?

you would have to capture the mouse on the client anyhoo

1 Like

You could probably detect if it’s moving on the X axis without changing the Y axis. No human could draw a line with the mouse perfectly.

1 Like

So I guess, if the mouse x or y is extremely similar each time, I could kick the player.