"HUDPaint" Aimbot
Code:
LocalPlayer():ConCommand("cl_interp 0;cl_interp_ratio 0; cl_updaterate 200; cl_cmdrate 200")
/*
AIMBOT
*/
local function GetAimVec(v)
if v != nil then
local pos, ang = v:GetBonePosition(v:LookupBone("ValveBiped.Bip01_Head1"));
pos = pos + ang:Forward() * 2;
return pos;
end
return;
end
local function GetAimPos(vec)
if vec != nil then
local ang = (vec - LocalPlayer():GetShootPos()):Angle();
return ang;
end
return;
end
local function _IsValid(v)
return (v != LocalPlayer() && IsValid(v) && v:Alive() && v:Health() >= 0 && !v:IsDormant());
end
local function VisCheck(v)
local trace =
{
start = LocalPlayer():GetShootPos(),
endpos = GetAimVec(v),
mask = MASK_SHOT,
filter = {LocalPlayer(), v}
};
local tr = util.TraceLine(trace);
return tr.Fraction == 1;
end
local function GetTarget()
_target, target = nil;
for k,v in next, player.GetAll() do
if !_IsValid(v) then continue; end
_target = v;
if !VisCheck(_target) then continue; end
target = v;
end
end
local function AimBot(cmd)
if (target != nil) then
cmd:SetViewAngles(GetAimPos(GetAimVec(target)))
end
end
local function Visuals()
if (_target != nil) then
local eye = _target:EyeAngles();
local min, max = _target:OBBMins(), _target:OBBMaxs();
local origin = _target:GetPos();
local eye = _target:EyeAngles();
cam.Start3D()
render.DrawWireframeBox(origin, Angle(0, eye.y, 0), min, max, team.GetColor(_target:Team()))
cam.End3D()
end
end
/*
HOOKING
*/
oCreateMove = oCreateMove or GAMEMODE.CreateMove;
function GAMEMODE:CreateMove(cmd)
oCreateMove(cmd)
AimBot(cmd)
end
GAMEMODE["HUDPaint"] = function(self)
Visuals(self)
end
GAMEMODE["Think"] = function(self)
GetTarget(self)
end

