Code:
require("dickwrap")
require("bsendpacket")
local _R = debug.getregistry()
local r = _R["__r"] or table.Copy(_R)
_R["__r"] = r
local me = LocalPlayer()
local ok = {}
ok.aaa = {}
ok.ys = GetConVarNumber("m_yaw")
ok.aas = false
ok.atk = false
ok.ct = 0
ok.flt = 0
ok.fltm = 0
ok.fa = nil
ok.sp = nil
ok.ep = nil
ok.vars = {
aimbot = {
enabled = CreateClientConVar("ok_aimbot", 1),
bodyaim = CreateClientConVar("ok_aimbot_body", 0),
static = CreateClientConVar("ok_aimbot_staticaa", 1),
team = CreateClientConVar("ok_aimbot_ignoreteam", 1),
friends = CreateClientConVar("ok_aimbot_ignorefriends", 0)
},
visuals = {
enabled = CreateClientConVar("ok_esp", 1),
name = CreateClientConVar("ok_esp_name", 1),
health = CreateClientConVar("ok_esp_health", 1),
rank = CreateClientConVar("ok_esp_rank", 1),
team = CreateClientConVar("ok_esp_team", 1)
},
hvh = {
antiaim = CreateClientConVar("ok_hvh_antiaim", 0),
jitter = CreateClientConVar("ok_hvh_aa_jitter", 0),
pitch = CreateClientConVar("ok_hvh_aa_pitch", 262),
yaw = CreateClientConVar("ok_hvh_aa_yaw", 450),
yawbase = CreateClientConVar("ok_hvh_aa_yawbase", 360),
yawadd = CreateClientConVar("ok_hvh_aa_yawadd", 45),
fakelag = CreateClientConVar("ok_hvh_fakelag", 0),
flchoke = CreateClientConVar("ok_hvh_fl_choke", 7),
flsend = CreateClientConVar("ok_hvh_fl_send", 3)
},
thirdperson = CreateClientConVar("ok_thirdperson", 1)
}
ok.pitches = {
["-90"] = {
-1.05,
},
["90"] = {
-5.00,
1.05,
-5.00,
1.05,
}
}
function _R.Entity.FireBullets(e, b)
local wep = me:GetActiveWeapon()
if !wep then return r.Entity.FireBullets(e, b) end
ok.cones[wep:GetClass()] = b.Spread or nil
return r.Entity.FireBullets(e, b)
end
ok.cones = {}
function ok.GetCone(wep)
local cone = 0
if !wep then return nil end
if wep.Cone then cone = wep.Cone end
if wep.Primary and wep.Primary.Cone then cone = wep.Primary.Cone end
if wep.Secondary and wep.Secondary.Cone then cone = wep.Secondary.Cone end
if cone != 0 then return Vector(-cone, -cone, -cone) end
return nil
end
function ok.Compensate(cmd, ang)
local wep = me:GetActiveWeapon()
if !IsValid(wep) then return ang end
local cone = ok.GetCone(wep) or ok.cones[wep:GetClass()]
if !cone then return ang end
return dickwrap.Predict(cmd, ang:Forward(), cone):Angle() or ang
end
function ok.CheckVis(ent)
local sp = me:GetShootPos()
local ep = !ok.vars["aimbot"]["bodyaim"]:GetBool() and (ent:GetAttachment(ent:LookupAttachment("eyes") or ent:LookupAttachment("forward")).Pos) or ent:GetPos() + ent:OBBCenter()
local tdata = {
start = sp,
endpos = ep,
filter = {ent, me},
mask = MASK_SHOT
}
local trace = util.TraceLine(tdata)
if trace.Fraction == 1 then
return true, sp, ep + ((ent:GetVelocity() * engine.TickInterval()) - (me:GetVelocity() * engine.TickInterval()))
else
return false
end
end
function ok.GetTarget()
local vis
ok.sp, ok.ep = nil, nil
for k,v in next, player.GetAll() do
if !ok.vars["aimbot"]["enabled"]:GetBool() or !v or !v:IsPlayer() or 0 >= v:Health() or v:IsDormant() or v == me then continue end
if ok.vars["aimbot"]["team"]:GetBool() and v:Team() == me:Team() then continue end
if ok.vars["aimbot"]["friends"]:GetBool() and v:GetFriendStatus() == "friend" then continue end
vis, ok.sp, ok.ep = ok.CheckVis(v)
if vis then break else continue end
end
end
function ok.DoSilent(cmd)
if !ok.fa then ok.fa = cmd:GetViewAngles() end
ok.fa = ok.fa + Angle(cmd:GetMouseY() * ok.ys, cmd:GetMouseX() * -ok.ys, 0)
ok.fa.p = math.Clamp(ok.fa.p, -89, 89)
ok.fa.y = math.NormalizeAngle(ok.fa.y)
end
function ok.FixMove(cmd, aa)
local fix = Vector(cmd:GetForwardMove(), cmd:GetSideMove(), 0)
fix = (fix:Angle() + cmd:GetViewAngles() - Angle(0, ok.fa.y, 0)):Forward() * fix:Length()
if aa then
cmd:SetForwardMove(fix.x)
cmd:SetSideMove(fix.y * -1)
return
end
cmd:SetForwardMove(fix.x)
cmd:SetSideMove(fix.y)
end
function ok.GetCurTime()
if IsFirstTimePredicted() then
ok.ct = CurTime() + engine.TickInterval()
end
end
function ok.CanFire()
if !ok.ct or ok.ct == 0 then return false end
local wep = me:GetActiveWeapon() or NULL
if !IsValid(wep) then return false end
return wep:GetActivity() != ACT_RELOAD and ok.ct > wep:GetNextPrimaryFire()
end
function ok.Aimbot(cmd)
ok.DoSilent(cmd)
if cmd:CommandNumber() == 0 and !ok.vars["thirdperson"]:GetBool() then cmd:SetViewAngles(ok.fa) return end
if !ok.vars["hvh"]["fakelag"]:GetBool() then
bSendPacket = true
end
if ok.sp and ok.ep then
local aafix = false
local ap = ok.Compensate(cmd, (ok.ep - ok.sp):Angle())
ap.p, ap.y = math.NormalizeAngle(ap.p), math.NormalizeAngle(ap.y)
if ok.CanFire() then
if ok.vars["aimbot"]["static"]:GetBool() then
aafix = true
ap.p = -ap.p - 180
ap.y = ap.y + 180
end
cmd:SetViewAngles(ap)
cmd:SetButtons(bit.bor(cmd:GetButtons(), IN_ATTACK))
ok.FixMove(cmd, aafix)
if !ok.vars["hvh"]["fakelag"]:GetBool() then
bSendPacket = false
end
else
if ok.vars["hvh"]["antiaim"]:GetBool() then
ok.AntiAim(cmd, true)
else
cmd:SetViewAngles(ok.fa)
end
if !ok.vars["hvh"]["fakelag"]:GetBool() then
bSendPacket = true
end
end
return
end
cmd:SetViewAngles(ok.fa)
end
ok.aayaws = {}
function ok.AntiAim(cmd, force)
if cmd:CommandNumber() == 0 and !ok.vars["thirdperson"]:GetBool() then return end
if !force and (cmd:KeyDown(IN_ATTACK) or ok.sp != nil or ok.ep != nil) then return end
for i = 1, 2 do
ok.aayaws[i] = (ok.vars["hvh"]["yawbase"]:GetInt() * i) + ok.vars["hvh"]["yawadd"]:GetInt()
end
ok.aayaws[3] = (ok.vars["hvh"]["yawbase"]:GetInt() * 3) + ok.vars["hvh"]["yawadd"]:GetInt() + 5
if ok.vars["hvh"]["antiaim"]:GetBool() then
local pitch = ok.vars["hvh"]["pitch"]:GetFloat() or 262
local yaw = ok.vars["hvh"]["yaw"]:GetFloat() or 450
if ok.vars["hvh"]["jitter"]:GetBool() then
cmd:SetViewAngles(Angle(pitch, table.Random(ok.aayaws) + math.random(-2, 2), 0))
else
cmd:SetViewAngles(Angle(pitch + (ok.aas and 1 or 0), yaw, 0))
end
ok.aas = !ok.aas
ok.FixMove(cmd, (pitch > 90 or -90 > pitch) and true or false)
end
end
function ok.FakeLag(cmd)
if cmd:CommandNumber() == 0 then return end
local choke = ok.vars["hvh"]["flchoke"]:GetInt()
local send = ok.vars["hvh"]["flsend"]:GetInt()
ok.fltm = choke + send
if ok.vars["hvh"]["fakelag"]:GetBool() then
ok.flt = ok.flt + 1
if ok.flt > ok.fltm then
ok.flt = 1
end
if send >= ok.flt then
bSendPacket = true
else
bSendPacket = false
end
end
end
function ok.CheckAAA(ply)
for f,t in next, ok.pitches do
for i,p in next, t do
if tonumber(string.sub(tostring(ply:EyeAngles().x), 1, 5)) == p then
ply:SetRenderAngles(Angle(0, ply:EyeAngles().y + 180, 0))
ply:SetPoseParameter("aim_pitch", tonumber(f))
ply:InvalidateBoneCache()
end
end
end
end
function ok.AutoHop(cmd)
if me:IsOnGround() and cmd:KeyDown(IN_JUMP) then
cmd:SetButtons(bit.bor(cmd:GetButtons(), IN_JUMP))
else
cmd:RemoveKey(IN_JUMP)
end
end
function ok.Visuals()
for k,v in next, player.GetAll() do
if !ok.vars["visuals"]["enabled"]:GetBool() or !v:IsValid() or !v:IsPlayer() or !v:Alive() or 0 >= v:Health() or v == me then continue end
local min, max, pos = v:OBBMins(), v:OBBMaxs(), v:GetPos()
local top, bottom = (pos + Vector(0, 0, max.z)):ToScreen(), pos:ToScreen()
if ok.vars["visuals"]["name"]:GetBool() then
draw.SimpleText(v:Nick(), "Trebuchet18", top.x, top.y - 12, v:Team() == me:Team() and Color(0, 255, 0) or Color(255, 0, 0), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
end
if ok.vars["visuals"]["health"]:GetBool() then
local health = v:Health()
local col = health >= 101 and Color(0, 200, 0) or Color(0, 255, 0)
draw.SimpleText(tostring(health), "Trebuchet18", bottom.x, bottom.y + 12, col, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
end
if ok.vars["visuals"]["rank"]:GetBool() then
local rank = v:GetUserGroup()
draw.SimpleText(rank, "Trebuchet18", bottom.x, bottom.y + 24, (rank == "guest" or rank == "user") and Color(255, 255, 0) or Color(255, 0, 0), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
end
if ok.vars["visuals"]["team"]:GetBool() then
local tm = v:Team()
draw.SimpleText(team.GetName(tm), "Trebuchet18", bottom.x, bottom.y + 36, team.GetColor(tm), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
end
end
end
function ok.CalcView(ply, pos, angle, fov, nearZ, farZ)
local view = {}
view.angles = ok.fa
view.origin = ok.vars["thirdperson"]:GetBool() and (pos - ok.fa:Forward() * 100) or pos
return view
end
function ok.ShouldDrawLocalPlayer()
return ok.vars["thirdperson"]:GetBool()
end
function ok.PreDrawOpaqueRenderables()
for k,v in next, player.GetAll() do
ok.CheckAAA(v)
end
for e,a in next, ok.aaa do
if !e or !IsValid(e) or !e:IsPlayer() then ok.aaa[e] = nil continue end
e:SetRenderAngles(Angle(0, a.y, 0))
e:SetPoseParameter("aim_pitch", a.p)
e:InvalidateBoneCache()
end
end
function ok.AAAMenu()
local last = 0
local frame = vgui.Create("DFrame")
frame:SetSize(350, 300)
frame:SetPos(0, 0)
frame:SetTitle("AAA Menu")
frame:Center()
frame:MakePopup()
local lista = vgui.Create("DListView", frame)
lista:SetPos(0, 24)
lista:SetSize(250, 276)
lista:SetMultiSelect(false)
lista:AddColumn("Players")
lista:AddColumn("Pitch")
lista:AddColumn("Yaw")
local ply = 0
lista.OnRowSelected = function(panel, line)
ply = line
end
local plabel = vgui.Create("DLabel", frame)
plabel:SetPos(255, 26)
plabel:SetText("Pitch:")
local ylabel = vgui.Create("DLabel", frame)
ylabel:SetPos(255, 40)
ylabel:SetText("Yaw:")
local ptext = vgui.Create("DTextEntry", frame)
ptext:SetPos(285, 30)
ptext:SetSize(30, 14)
ptext:SetText("89")
ptext.OnEnter = function() end
local ytext = vgui.Create("DTextEntry", frame)
ytext:SetPos(285, 44)
ytext:SetSize(30, 14)
ytext:SetText("180")
ytext.OnEnter = function() end
local but = vgui.Create("DButton", frame)
but:SetPos(255, 66)
but:SetSize(65, 24)
but:SetText("Set")
function but.DoClick()
if player.GetAll()[ply] then
ok.aaa[player.GetAll()[ply]] = Angle(tonumber(ptext:GetText()), tonumber(ytext:GetText()), 0)
end
end
for i = 1, #player.GetAll() do
local e = player.GetAll()[i]
lista:AddLine(e:Nick(), e:EyeAngles().p, e:EyeAngles().y)
end
end
hook.Add("Think", "ok.GetTarget", ok.GetTarget)
hook.Add("Move", "ok.GetCurTime", ok.GetCurTime)
hook.Add("CreateMove", "ok.Aimbot", ok.Aimbot)
hook.Add("CreateMove", "ok.AntiAim", ok.AntiAim)
hook.Add("CreateMove", "ok.FakeLag", ok.FakeLag)
hook.Add("CreateMove", "ok.AutoHop", ok.AutoHop)
hook.Add("DrawOverlay", "ok.Visuals", ok.Visuals)
hook.Add("CalcView", "ok.CalcView", ok.CalcView)
hook.Add("ShouldDrawLocalPlayer", "ok.ShouldDrawLocalPlayer", ok.ShouldDrawLocalPlayer)
hook.Add("PreDrawOpaqueRenderables", "ok.PreDrawOpaqueRenderables", ok.PreDrawOpaqueRenderables)
concommand.Add("ok_aaa", ok.AAAMenu)