VAC protection does _nothing_ against lua scripts, script enforcer bypassing can get you banned, but not Lua scripts themselves.
I wrote this a while ago but it still works like a charm
--[[
Name: s0beit.lua
Product: Client-side LUA hook
Author: s0beit
]]--
--Start of config
local s0beitEspCvar = CreateClientConVar( "s0beit_esp", 1, true, false )
local s0beitCroCvar = CreateClientConVar( "s0beit_xhair", 0, true, false )
--End of config
local function HeadPos(ply)
if ValidEntity(ply) then
local hbone = ply:LookupBone("ValveBiped.Bip01_Head1")
return ply:GetBonePosition(hbone)
else return end
end
local function Visible(ply)
local trace = {start = LocalPlayer():GetShootPos(),endpos = HeadPos(ply),filter = {LocalPlayer(), ply}}
local tr = util.TraceLine(trace)
if tr.Fraction == 1 then
return true
else
return false
end
end
local function IsSteamFriend( ply )
return ply:GetFriendStatus() == "friend"
end
local function FillRGBA(x,y,w,h,col)
surface.SetDrawColor( col.r, col.g, col.b, col.a );
surface.DrawRect( x, y, w, h );
end
local function OutlineRGBA(x,y,w,h,col)
surface.SetDrawColor( col.r, col.g, col.b, col.a );
surface.DrawOutlinedRect( x, y, w, h );
end
local function DrawCrosshair()
local w = ScrW() / 2;
local h = ScrH() / 2;
FillRGBA( w - 5, h, 11, 1, Color( 255, 0, 0, 255 ) );
FillRGBA( w, h - 5, 1, 11, Color( 255, 0, 0, 255 ) );
end
function DrawESP()
if s0beitEspCvar:GetInt() == 1 then
for k, v in pairs(ents.GetAll()) do
if( ValidEntity(v) and v ~= LocalPlayer() ) then
if( v:IsNPC() ) then
local drawColor = Color(255, 255, 255, 255);
local drawPosit = v:GetPos():ToScreen();
if( Visible(v) ) then
drawColor = Color( 255, 0, 0, 255 );
else
drawColor = Color( 0, 255, 0, 255 );
end
local textData = {}
textData.pos = {}
textData.pos[1] = drawPosit.x;
textData.pos[2] = drawPosit.y;
textData.color = drawColor;
textData.text = v:GetClass();
textData.font = "DefaultFixed";
textData.xalign = TEXT_ALIGN_CENTER;
textData.yalign = TEXT_ALIGN_CENTER;
draw.Text( textData );
elseif( v:IsPlayer() and v:Health() > 0 and v:Alive() ) then
local drawColor = team.GetColor(v:Team());
local drawPosit = v:GetPos():ToScreen();
if( Visible(v) ) then
drawColor.a = 255;
else
drawColor.r = 255 - drawColor.r;
drawColor.g = 255 - drawColor.g;
drawColor.b = 255 - drawColor.b;
end
local textData = {}
textData.pos = {}
textData.pos[1] = drawPosit.x;
textData.pos[2] = drawPosit.y;
textData.color = drawColor;
textData.text = v:GetName();
textData.font = "DefaultFixed";
textData.xalign = TEXT_ALIGN_CENTER;
textData.yalign = TEXT_ALIGN_CENTER;
draw.Text( textData );
local max_health = 100;
if( v:Health() > max_health ) then
max_health = v:Health();
end
local mx = max_health / 4;
local mw = v:Health() / 4;
local drawPosHealth = drawPosit;
drawPosHealth.x = drawPosHealth.x - ( mx / 2 );
drawPosHealth.y = drawPosHealth.y + 10;
FillRGBA( drawPosHealth.x - 1, drawPosHealth.y - 1, mx + 2, 4 + 2, Color( 0, 0, 0, 255 ) );
FillRGBA( drawPosHealth.x, drawPosHealth.y, mw, 4, drawColor );
end
end
end
end
end
function DrawXHair()
if( s0beitCroCvar:GetInt() == 1 ) then
DrawCrosshair();
end
end
hook.Add( "HUDPaint", "DrawESP", DrawESP );
hook.Add( "HUDPaint", "DrawXHair", DrawXHair );
Simple ESP and crosshair