//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.
Text moved with changes to lines 415-436 (99.1% similarity)
Sasha.Bones = {
"ValveBiped.Bip01_Head1",
"ValveBiped.Bip01_Neck1",
"ValveBiped.Bip01_Spine4",
"ValveBiped.Bip01_Spine2",
"ValveBiped.Bip01_Spine1",
"ValveBiped.Bip01_Spine",
"ValveBiped.Bip01_R_UpperArm",
"ValveBiped.Bip01_R_Forearm",
"ValveBiped.Bip01_R_Hand",
"ValveBiped.Bip01_L_UpperArm",
"ValveBiped.Bip01_L_Forearm",
"ValveBiped.Bip01_L_Hand",
"ValveBiped.Bip01_R_Thigh",
"ValveBiped.Bip01_R_Calf",
"ValveBiped.Bip01_R_Foot",
"ValveBiped.Bip01_R_Toe0",
"ValveBiped.Bip01_L_Thigh",
"ValveBiped.Bip01_L_Calf",
"ValveBiped.Bip01_L_Foot",
"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.
local keys = {}
//If you edit this be sure to edit the function below it.
keys.Message = function(...)
Text moved with changes to lines 437-444 (98.3% similarity)
Sasha.RandomBones = {
chat.AddText(Color(50, 255, 100), "Keys ", ...)
"ValveBiped.Bip01_Head1",
"ValveBiped.Bip01_Neck1",
"ValveBiped.Bip01_Spine4",
"ValveBiped.Bip01_Spine2",
"ValveBiped.Bip01_R_UpperArm",
"ValveBiped.Bip01_L_UpperArm"
}
Sasha.GetRandomBones = function()
local temp = {}
local function GetBones() //Ahh recursion, i love you.
//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.
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 shouldremove = false
if Sasha.Aimbot.Vars["IgnoreTeam"]:GetBool() and v:IsPlayer() then
if Sasha.TTT then
if Sasha.Ply:GetRole() == 1 and v:GetRole() == 1 then
shouldremove = true
end
if Sasha.Ply:GetRole() != 1 and not table.HasValue(Sasha.Traitors, v) then
shouldremove = true
end
else
if v:Team() == Sasha.Ply:Team() then
shouldremove = true
end
end
end
if Sasha.Friends.Vars["Active"]:GetBool() then
if Sasha.Friends.Vars["Reverse"]:GetBool() then
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
end
HackB.CanSee = function(ent)
//This returns the total angle away from the target we are, and then the pitch and yaw seperately
for k = 1, #HackB.Bones do
Sasha.AngleTo = function(pos)
local v = HackB.Bones[k]
local myAngs = Sasha.Ply:GetAngles()
local bone = ent:LookupBone(v)
local needed = (pos - Sasha.Ply:GetShootPos()):Angle()
if bone != nil then
local pos, ang = ent:GetBonePosition(bone)
myAngs.p = math.NormalizeAngle(myAngs.p)
if HackB.SpotIsVisible(pos, ent) then
needed.p = math.NormalizeAngle(needed.p)
return true
end
myAngs.y = math.NormalizeAngle(myAngs.y)
end
needed.y = math.NormalizeAngle(needed.y)
end
return false
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
end
HackB.GetTarget = function()
//Returns true if our target meets our preferances.
if HackB.Aimbot.Vars["AttackNPCs"]:GetBool() or HackB.Aimbot.Vars["AttackPlayers"]:GetBool() then
Sasha.ValidTarget = function()
local targets = {}
if Sasha.Aimbot.CurTarget == nil then return false end
local everything = ents.GetAll()
if not IsValid(Sasha.Aimbot.CurTarget) then return false end
for k = 1, #everything do
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
local v = everything[k]
if not Sasha.Aimbot.Vars["AttackNPCs"]:GetBool() and Sasha.Aimbot.CurTarget:IsNPC() then return false end
if HackB.Aimbot.Vars["AttackNPCs"]:GetBool() and v:IsNPC() then
if not Sasha.Aimbot.Vars["AttackPlayers"]:GetBool() and Sasha.Aimbot.CurTarget:IsPlayer() then return false end
if HackB.CanSee(v) then
if not Sasha.CanSee(Sasha.Aimbot.CurTarget) then return false end
if Sasha.Aimbot.CurTarget:Team() == Sasha.Ply:Team() then return false end
end
end
end
end
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
return true
local v = v["Target"]
local shouldremove = false
if HackB.Aimbot.Vars["IgnoreTeam"]:GetBool() and v:IsPlayer() then
if HackB.TTT then
if HackB.Ply:GetRole() == 1 and v:GetRole() == 1 then
shouldremove = true
end
if HackB.Ply:GetRole() != 1 and not table.HasValue(HackB.Traitors, v) then
shouldremove = true
end
else
if v:Team() == HackB.Ply:Team() then
shouldremove = true
end
end
end
if HackB.Friends.Vars["Active"]:GetBool() then
if HackB.Friends.Vars["Reverse"]:GetBool() then
if not table.HasValue(HackB.Friends.List, v:SteamID()) then
shouldremove = true
end
else
if table.HasValue(HackB.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 HackB.Aimbot.Vars["Preferance"]:GetString() == "Distance" then
local min = {["Distance"] = HackB.Ply:GetPos():Distance(targets[1]["Pos"]), ["Target"] = targets[1]["Target"]}
for k = 1, #targets do
local v = targets[k]
local distance = HackB.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 HackB.Aimbot.Vars["Preferance"]:GetString() == "Angle" then
local min = {["Angle"] = HackB.AngleTo(targets[1]["Pos"]), ["Target"] = targets[1]["Target"]}
for k = 1, #targets do
local v = targets[k]
local angle = HackB.AngleTo(v["Pos"])
if angle < min["Angle"] then
min = {["Angle"] = angle, ["Target"] = v["Target"]}
local needed = (pos - HackB.Ply:GetShootPos()):Angle()
local everything = ents.GetAll()
for k = 1, #everything do
myAngs.p = math.NormalizeAngle(myAngs.p)
local v = everything[k]
needed.p = math.NormalizeAngle(needed.p)
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
myAngs.y = math.NormalizeAngle(myAngs.y)
cam.Start3D(EyePos(), EyeAngles())
needed.y = math.NormalizeAngle(needed.y)
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
local p = math.NormalizeAngle(needed.p - myAngs.p)
if Sasha.Chams.Vars["TeamBased"]:GetBool() and v:IsPlayer() then
local y = math.NormalizeAngle(needed.y - myAngs.y)