this is what the code looks like. It works in studio but it doesn’t detect actuall aimbots.
This specific script only detects aimbots that locks onto a part in workspace. So if u want to try this simply add a part to workspace and name it (“Part”)
local UserInputService = game:GetService("UserInputService")
local runService = game:GetService("RunService")
local player = game:GetService("Players").LocalPlayer
local camera = workspace.CurrentCamera
local part = game:GetService("Workspace").Part
local loop_check = false
UserInputService.InputBegan:Connect(function(Input)
if Input.UserInputType == Enum.UserInputType.MouseButton2 then
loop_check = true
while loop_check do
wait()
--local delta = UserInputService:GetMouseDelta()
--print(delta.X, delta.Y)--Attempted to use delta mouse movement didn't work at all
--camera.CFrame = CFrame.lookAt(game.Players.LocalPlayer.Character.HumanoidRootPart.Position, part.Position) --Uncomment this to turn the aimbot on
local lookat = part.Position
local pos = game.Players.LocalPlayer.Character.HumanoidRootPart.Position
local cam_check = CFrame.new(lookat, pos)
if camera.CFrame == cam_check then
game.Players.LocalPlayer:Kick("Aimbot detected")
end
end
end
end)
UserInputService.InputEnded:Connect(function(Input)
if Input.UserInputType == Enum.UserInputType.MouseButton2 then
loop_check = false
end
end)