//This is all the bones i look for in the order im looking for them. Feel free to change the order if you want to attack the foot before the head or something like that.
//This is all the bones i look for in the order im looking for them. Feel free to change the order if you want to attack the foot before the head or something like that.
AHack.Bones = {
Sasha.Bones = {
"ValveBiped.Bip01_Head1",
"ValveBiped.Bip01_Head1",
"ValveBiped.Bip01_Neck1",
"ValveBiped.Bip01_Neck1",
"ValveBiped.Bip01_Spine4",
"ValveBiped.Bip01_Spine4",
"ValveBiped.Bip01_Spine2",
"ValveBiped.Bip01_Spine2",
"ValveBiped.Bip01_Spine1",
"ValveBiped.Bip01_Spine1",
"ValveBiped.Bip01_Spine",
"ValveBiped.Bip01_Spine",
"ValveBiped.Bip01_R_UpperArm",
"ValveBiped.Bip01_R_UpperArm",
"ValveBiped.Bip01_R_Forearm",
"ValveBiped.Bip01_R_Forearm",
"ValveBiped.Bip01_R_Hand",
"ValveBiped.Bip01_R_Hand",
"ValveBiped.Bip01_L_UpperArm",
"ValveBiped.Bip01_L_UpperArm",
"ValveBiped.Bip01_L_Forearm",
"ValveBiped.Bip01_L_Forearm",
"ValveBiped.Bip01_L_Hand",
"ValveBiped.Bip01_L_Hand",
"ValveBiped.Bip01_R_Thigh",
"ValveBiped.Bip01_R_Thigh",
"ValveBiped.Bip01_R_Calf",
"ValveBiped.Bip01_R_Calf",
"ValveBiped.Bip01_R_Foot",
"ValveBiped.Bip01_R_Foot",
"ValveBiped.Bip01_R_Toe0",
"ValveBiped.Bip01_R_Toe0",
"ValveBiped.Bip01_L_Thigh",
"ValveBiped.Bip01_L_Thigh",
"ValveBiped.Bip01_L_Calf",
"ValveBiped.Bip01_L_Calf",
"ValveBiped.Bip01_L_Foot",
"ValveBiped.Bip01_L_Foot",
"ValveBiped.Bip01_L_Toe0"
"ValveBiped.Bip01_L_Toe0"
}
}
//If random bones is enabled this list is gone through, randomly, and if none of the bones on this list are found the entire list (above) is gone through.
//If random bones is enabled this list is gone through, randomly, and if none of the bones on this list are found the entire list (above) is gone through.
//If you edit this be sure to edit the function below it.
//If you edit this be sure to edit the function below it.
AHack.RandomBones = {
Sasha.RandomBones = {
"ValveBiped.Bip01_Head1",
"ValveBiped.Bip01_Head1",
"ValveBiped.Bip01_Neck1",
"ValveBiped.Bip01_Neck1",
"ValveBiped.Bip01_Spine4",
"ValveBiped.Bip01_Spine4",
"ValveBiped.Bip01_Spine2",
"ValveBiped.Bip01_Spine2",
"ValveBiped.Bip01_R_UpperArm",
"ValveBiped.Bip01_R_UpperArm",
"ValveBiped.Bip01_L_UpperArm"
"ValveBiped.Bip01_L_UpperArm"
}
}
AHack.GetRandomBones = function()
Sasha.GetRandomBones = function()
local temp = {}
local temp = {}
local function GetBones() //Ahh recursion, i love you.
local function GetBones() //Ahh recursion, i love you.
//Tells me if a specific key is pressed. Loops through both tables.
//Tells me if a specific key is pressed. Loops through both tables.
AHack.KeyPressed = function(key)
Sasha.KeyPressed = function(key)
if AHack.InChat then return false end
if Sasha.InChat then return false end
for k = 107, 111 do
for k = 107, 111 do
if key == AHack.MouseKeys[k] then
if key == Sasha.MouseKeys[k] then
if input.IsMouseDown(k) then
if input.IsMouseDown(k) then
return true
return true
else
else
return false
return false
end
end
end
end
end
end
for k = 0, 130 do
for k = 0, 130 do
if key == AHack.Keys[k] then
if key == Sasha.Keys[k] then
if input.IsKeyDown(k) then
if input.IsKeyDown(k) then
return true
return true
else
else
return false
return false
end
end
end
end
end
end
return false
return false
end
end
//Very simple. If the boolean is true it returns 1. If the boolean is false then it returns 0. I dont think i ended up using this anywhere, but whatever, ill leave it here.
//Very simple. If the boolean is true it returns 1. If the boolean is false then it returns 0. I dont think i ended up using this anywhere, but whatever, ill leave it here.
AHack.BoolToInt = function(bool)
Sasha.BoolToInt = function(bool)
if bool then
if bool then
return 1
return 1
else
else
return 0
return 0
end
end
end
end
//Checking if a bone is visible, pos is the position of the bone and ent is the entity whos bone were looking for.
//Checking if a bone is visible, pos is the position of the bone and ent is the entity whos bone were looking for.
AHack.SpotIsVisible = function(pos, ent)
Sasha.SpotIsVisible = function(pos, ent)
ent = ent or AHack.Aimbot.CurTarget
ent = ent or Sasha.Aimbot.CurTarget
local tracedata = {}
local tracedata = {}
tracedata.start = AHack.Ply:GetShootPos()
tracedata.start = Sasha.Ply:GetShootPos()
tracedata.endpos = pos
tracedata.endpos = pos
tracedata.filter = {AHack.Ply, ent}
tracedata.filter = {Sasha.Ply, ent}
local trace = util.TraceLine(tracedata)
local trace = util.TraceLine(tracedata)
if trace.HitPos:Distance(pos) < 0.005 then
if trace.HitPos:Distance(pos) < 0.005 then
return true
return true
else
else
return false
return false
end
end
end
end
//Checks all of the entities bones to find if we can see this entity or not.
//Checks all of the entities bones to find if we can see this entity or not.
AHack.CanSee = function(ent)
Sasha.CanSee = function(ent)
for k = 1, #AHack.Bones do
for k = 1, #Sasha.Bones do
local v = AHack.Bones[k]
local v = Sasha.Bones[k]
local bone = ent:LookupBone(v)
local bone = ent:LookupBone(v)
if bone != nil then
if bone != nil then
local pos, ang = ent:GetBonePosition(bone)
local pos, ang = ent:GetBonePosition(bone)
if AHack.SpotIsVisible(pos, ent) then
if Sasha.SpotIsVisible(pos, ent) then
return true
return true
end
end
end
end
end
end
return false
return false
end
end
//This returns the next entity we should attack.
//This returns the next entity we should attack.
AHack.GetTarget = function()
Sasha.GetTarget = function()
if AHack.Aimbot.Vars["AttackNPCs"]:GetBool() or AHack.Aimbot.Vars["AttackPlayers"]:GetBool() then
if Sasha.Aimbot.Vars["AttackNPCs"]:GetBool() or Sasha.Aimbot.Vars["AttackPlayers"]:GetBool() then
local targets = {}
local targets = {}
local everything = ents.GetAll()
local everything = ents.GetAll()
for k = 1, #everything do
for k = 1, #everything do
local v = everything[k]
local v = everything[k]
if AHack.Aimbot.Vars["AttackNPCs"]:GetBool() and v:IsNPC() then
if Sasha.Aimbot.Vars["AttackNPCs"]:GetBool() and v:IsNPC() then
for k,v in SortedPairs(targets, true) do //It will already be sorted so this shouldn't be too resource heavy, the main point of this is to loop through the table backwards
for k,v in SortedPairs(targets, true) do //It will already be sorted so this shouldn't be too resource heavy, the main point of this is to loop through the table backwards
local v = v["Target"]
local v = v["Target"]
local shouldremove = false
local shouldremove = false
if AHack.Aimbot.Vars["IgnoreTeam"]:GetBool() and v:IsPlayer() then
if Sasha.Aimbot.Vars["IgnoreTeam"]:GetBool() and v:IsPlayer() then
if AHack.TTT then
if Sasha.TTT then
if AHack.Ply:GetRole() == 1 and v:GetRole() == 1 then
if Sasha.Ply:GetRole() == 1 and v:GetRole() == 1 then
shouldremove = true
shouldremove = true
end
end
if AHack.Ply:GetRole() != 1 and not table.HasValue(AHack.Traitors, v) then
if Sasha.Ply:GetRole() != 1 and not table.HasValue(Sasha.Traitors, v) then
shouldremove = true
shouldremove = true
end
end
else
else
if v:Team() == AHack.Ply:Team() then
if v:Team() == Sasha.Ply:Team() then
shouldremove = true
shouldremove = true
end
end
end
end
end
end
if AHack.Friends.Vars["Active"]:GetBool() then
if Sasha.Friends.Vars["Active"]:GetBool() then
if AHack.Friends.Vars["Reverse"]:GetBool() then
if Sasha.Friends.Vars["Reverse"]:GetBool() then
if not table.HasValue(AHack.Friends.L
if not table.HasValue(Sasha.Friends.List, v:SteamID()) then
shouldremove = true
end
else
if table.HasValue(Sasha.Friends.List, v:SteamID()) then
shouldremove = true
end
end
end
if shouldremove then
table.remove(targets, k)
end
end
if #targets == 0 then
return nil
elseif #targets == 1 then
targets[1]["Target"].BoneToAimAt = nil
return targets[1]["Target"]
end
if Sasha.Aimbot.Vars["Preferance"]:GetString() == "Distance" then
local min = {["Distance"] = Sasha.Ply:GetPos():Distance(targets[1]["Pos"]), ["Target"] = targets[1]["Target"]}
for k = 1, #targets do
local v = targets[k]
local distance = Sasha.Ply:GetPos():Distance(v["Pos"])
if distance < min["Distance"] then
min = {["Distance"] = distance, ["Target"] = v["Target"]}
end
end
min["Target"].BoneToAimAt = nil
return min["Target"]
elseif Sasha.Aimbot.Vars["Preferance"]:GetString() == "Angle" then
local min = {["Angle"] = Sasha.AngleTo(targets[1]["Pos"]), ["Target"] = targets[1]["Target"]}
for k = 1, #targets do
local v = targets[k]
local angle = Sasha.AngleTo(v["Pos"])
if angle < min["Angle"] then
min = {["Angle"] = angle, ["Target"] = v["Target"]}
end
end
min["Target"].BoneToAimAt = nil
return min["Target"]
end
else
return nil
end
end
//This returns the total angle away from the target we are, and then the pitch and yaw seperately
Sasha.AngleTo = function(pos)
local myAngs = Sasha.Ply:GetAngles()
local needed = (pos - Sasha.Ply:GetShootPos()):Angle()
myAngs.p = math.NormalizeAngle(myAngs.p)
needed.p = math.NormalizeAngle(needed.p)
myAngs.y = math.NormalizeAngle(myAngs.y)
needed.y = math.NormalizeAngle(needed.y)
local p = math.NormalizeAngle(needed.p - myAngs.p)
local y = math.NormalizeAngle(needed.y - myAngs.y)
return math.abs(p) + math.abs(y), {p = p, y = y}
end
//Returns true if our target meets our preferances.
Sasha.ValidTarget = function()
if Sasha.Aimbot.CurTarget == nil then return false end
if not IsValid(Sasha.Aimbot.CurTarget) then return false end
if Sasha.Aimbot.CurTarget:IsPlayer() and (not Sasha.Aimbot.CurTarget:Alive() or Sasha.Aimbot.CurTarget:Team() == TEAM_SPECTATOR or Sasha.Aimbot.CurTarget:Health() < 1) then return false end
if not Sasha.Aimbot.Vars["AttackNPCs"]:GetBool() and Sasha.Aimbot.CurTarget:IsNPC() then return false end
if not Sasha.Aimbot.Vars["AttackPlayers"]:GetBool() and Sasha.Aimbot.CurTarget:IsPlayer() then return false end
if not Sasha.CanSee(Sasha.Aimbot.CurTarget) then return false end
if Sasha.Aimbot.Vars["IgnoreTeam"]:GetBool() and Sasha.Aimbot.CurTarget:IsPlayer() then
if Sasha.TTT then
if Sasha.Ply:GetRole() == 1 and Sasha.Aimbot.CurTarget:GetRole() == 1 then return false end
if Sasha.Ply:GetRole() != 1 and not table.HasValue(Sasha.Traitors, Sasha.Aimbot.CurTarget) then return false end
else
if Sasha.Aimbot.CurTarget:Team() == Sasha.Ply:Team() then return false end
if Sasha.Chams.Vars["Active"]:GetBool() and v != Sasha.Ply and (Sasha.Chams.Vars["MaxDistance"]:GetInt() == 0 or v:GetPos():Distance(Sasha.Ply:GetPos()) < Sasha.Chams.Vars["MaxDistance"]:GetInt()) then
cam.Start3D(EyePos(), EyeAngles())
if (v:IsPlayer() and v:Alive() and v:Team() != TEAM_SPECTATOR and Sasha.Chams.Vars["Players"]:GetBool()) or (v:IsNPC() and v:Health() > 0 and Sasha.Chams.Vars["NPCs"]:GetBool()) then
local color = Sasha.Style.Vars["Chams"].color
if Sasha.Chams.Vars["TeamBased"]:GetBool() and v:IsPlayer() then