Aimbot / Aimlock Detection (First Person and 3rd Person) [New]

Intro

Hello, i don’t really know when i begun with my anti aimbot / aimlock project but it was a while ago. Note that this is a follow up on my old thread : Old Anti Aimbot

In the old thread I mentioned that I was going to do a follow up with a release of an Anti Aimbot / Aimlock with a lot less false flags which is what I’m doing in this thread.

Info

This Anti Aimbot / Aimlock detects and supports both First Person and Third Person games. Any bypasses for the Anti Aimbot should either be sent to me in messages or in this thread (I’ll patch them).


Script :

if not game:IsLoaded() then
	game.Loaded:Wait()
end

-- Service Variables
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")

-- // General Variables
local Player = Players.LocalPlayer
local Camera = workspace.CurrentCamera
local Mouse = Player:GetMouse()

-- // Config / Variables?
local Data = {
	
	Booleans = {
		Steady = true,
	},

	Connections = {
		RenderStepped = nil,
		Move = nil,
		Idle = nil,
	},
	
	Numbers = {
		Flags = 0,
		MaxFlags = 1,
	},

	Positions = {
		NewAcceleration = {},
		OldAcceleration = {},
		NewCameraOrientation = {},
		OldCameraOrientation = {},
	},
	
	Threads = {
		One = nil,
	},
	
}

-- // Camera movement speed and Camera Orientation
Data.Connections.Move = Mouse.Move:Connect(function()
	
    -- // Store Camera Orientation as Vector(X, Y, Z)
	Data.Positions.NewCameraOrientation = {
		Vector = math.ceil(Camera.CFrame:ToEulerAnglesXYZ()),
	}
	
    -- // Make a thread to make sure nothing in the connection yields upon task.wait
	Data.Threads.One = task.spawn(function()
		
        -- // Store Old Camera Positions as Vector(X, Y, Z)
		Data.Positions.OldAcceleration = {
			X = Camera.CFrame.Position.X,
			Y = Camera.CFrame.Position.Y,
			Z = Camera.CFrame.Position.Z,
		}
		
		task.wait(0.1)

        -- // Store New Camera Positions as Vector(X, Y, Z)
		Data.Positions.NewAcceleration = {
			X = Camera.CFrame.Position.X,
			Y = Camera.CFrame.Position.Y,
			Z = Camera.CFrame.Position.Z,
		}
		
        -- // Compare stored Camera Positions to calculate Camera movement speed (new - old)
		if 
			(
			Data.Positions.NewAcceleration.X - Data.Positions.OldAcceleration.X <= 0.6 and 
			Data.Positions.NewAcceleration.Y - Data.Positions.OldAcceleration.Y <= 0.6 and 
			Data.Positions.NewAcceleration.Z - Data.Positions.OldAcceleration.Z <= 0.6 and
			
			Data.Positions.NewAcceleration.X - Data.Positions.OldAcceleration.X >= -0.6 and 
			Data.Positions.NewAcceleration.Y - Data.Positions.OldAcceleration.Y >= -0.6 and
			Data.Positions.NewAcceleration.Z - Data.Positions.OldAcceleration.Z >= -0.6
			)
		then
			Data.Booleans.Steady = true
		else
			Data.Booleans.Steady = false
		end
	end)
	
end)

-- // Last Camera Position before mouse going idle
Data.Connections.Idle = Mouse.Idle:Connect(function()
	
	Data.Positions.OldCameraOrientation = {
		Vector = math.ceil(Camera.CFrame:ToEulerAnglesXYZ()),
	}
	
end)

-- // Compare stored values
Data.Connections.RenderStepped = RunService.RenderStepped:Connect(function()

    -- // Checks if Camera is moving within speed limit
	if Data.Booleans.Steady then
        -- // Return until Positions
		if Data.Positions.NewCameraOrientation.Vector and Data.Positions.OldCameraOrientation.Vector then
            -- // Checks if the new Camera Orientation is the same as the last Camera Orientation
			if Data.Positions.NewCameraOrientation.Vector ~= Data.Positions.OldCameraOrientation.Vector then
				Data.Numbers.Flags += 1
			end
		end
	end 
	
	if Data.Numbers.Flags >= Data.Numbers.MaxFlags then
		Player:Kick("Aimbot / Aimlock")
	end
end)

Note that this has NO checks for Hookfunctions, Hookmetamethods, Setconstants, Setupvalues, Disabling Connections nor does it have any detection to detect Disabling the script (If a bypass is made I’ll simply make an update with a patch to that bypass)

:saluting_face:

27 Likes

it seems cool and all, but yatta yatta, clientside stuff can just be deleted, blah blah

9 Likes

Yep using the client is probably the worst possible thing you could do when making an anti-cheat

3 Likes

Very good :+1: . It’s always good to prevent a hacker from doing something, rather then to do nothing at all. To everyone that just believes everything can be deleted, thats true… But the point of anti-cheat is to reduce the chance of hackers, not to completely diminish them.

7 Likes

Really tired of hearing the argument that client-sided anti-cheats are bad. They aren’t, regardless of what what people tell you or what crowd mentality is developed. The issue lies in people becoming reliant on them, and not securing the server.

While yes, this is client sided and therefor could be bypassed, the majority of exploiters don’t have the skill level to do so. This is a neat resource in which has been provided for free- and at the very least will delay exploiters, if not stop inexperienced ones entirely.

Good resource, well done.

And for those who believe that this can be easily bypassed, I assume you know what you’re talking about- so you can always implement some additional security such as anti-hookfunction methods, namecall spoofs, and environmental obstructers!

9 Likes

Bypass it then, prove me that it’s such a terrible thing.

1 Like

Yatta yatta, you won’t bypass it, won’t you? Read the enitre thread.

If your first thought about a Client Sided anti cheat is * They can just disable it / delete it * then read this thread I made : Handshake (Anti Cheat related) [Dynamic Server - Client Communication] - Resources / Community Resources - Developer Forum | Roblox

1 Like

This is really cool but I suggest not relying on game:IsLoaded() because

hookfunction(game.IsLoaded, function()
  return false
end)
1 Like

I would assume this would be for FPS game considering this is where you find people who use Aimlock, Aimbot, and general scripts/exploits/hacks, but wouldn’t something as simple as recoil trigger the anti-aimbot?

No, not as far as i know.

Could you possibly try it for me?

Wanna know something that’s really cool too?

game.IsLoaded is a rbxscriptconnection ( a connection ).

Well then just use getconnections and disable it

1 Like

This was mentioned in I think one of the very first replies to this post.

This “Aimbot Detection” is flawed as using the left/right arrow keys to pan the camera gets you falsely detected, and I couldn’t imagine how unstable this would be for non-pc platforms.

Also, this whole thing can simply be bypassed by just grabbing the Data table and just changing the max flags, like so:

for i,v in ipairs(getgc(true)) do
    if type(v) == "table" and rawget(v, "Numbers") and rawget(rawget(v, "Numbers"), "MaxFlags") then
        rawset(rawget(v, "Numbers"), "MaxFlags", math.huge)
        break
    end
end

Even so, most aimbots nowadays use mousemoverel which fire the Mouse.Move events and allow for mouse movements (bypassing this completely). Cool concept though!

3 Likes

This is a fairly okay bypass but it is detectable. Indexing my table will environment leak which will give me the executor’s environment that you’re using which itself allows me to do whatever I’d like to for eg. Ip log you.

Which breaks the rules of Roblox. Also, rawget

1 Like

Doesn’t exploiting already break the rules?

1 Like

Yes, but breaking the rules in your game will also get YOUR game banned and YOUR account deleted.

1 Like

Lucky me we’re not the same person

Oh so you’re immune to moderation? Good to know.

4 Likes