Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local fa;
- local aa;
- local aimtarget;
- local dists = {};
- local aimignore;
- local aimPos;
- local cones = {};
- local nullevec = Vector() * -1;
- local servertime = 0;
- local IsFirstTimePredicted = IsFirstTimePredicted;
- local reg = debug.getregistry();
- local originalFire = reg.Entity.FireBullets;
- local function fixmovement(userCmd, aaa)
- local side = Vector(userCmd:GetForwardMove(), userCmd:GetSideMove(), userCmd:GetUpMove());
- side = ((side:GetNormal()):Angle() + (userCmd:GetViewAngles() - fa)):Forward() * side:Length();
- userCmd:SetForwardMove(side.x);
- userCmd:SetSideMove(side.y);
- end
- local function getangle(angle)
- if(!settings["Misc"]["No Recoil"]) then return angle + ply.GetPunchAngle(me); end
- return angle;
- end
- local function predict(v, pos, fake)
- local myFrames = engine.TickInterval();
- local theirFrames = RealFrameTime() / 25;
- local myVelocity = ent.GetVelocity(me);
- local theirVelocity = ent.GetVelocity(v);
- local final = pos + (theirVelocity * theirFrames) - (myVelocity * myFrames);
- if(!fake) then return final; end
- return final + fake;
- end
- local function IsVis(v,pos)
- local traceData = {}
- traceData.start = predict(me,ent.EyePos(me));
- traceData.endpos = predict(me,pos);
- traceData.mask = MASK_SHOT;
- traceData.filter = function(entity) return !entity:IsPlayer() end
- local trace = util.TraceLine(traceData)
- return !trace.Hit
- end
- local function normalize(angle)
- angle.x = math.NormalizeAngle(angle.x);
- angle.p = math.Clamp(angle.p, -89, 89);
- end
- local hitBoxes = {
- ["Head"] = 0,
- ["L Upperarm"] = 1,
- ["L Forearm"] = 2,
- ["L Hand"] = 3,
- ["R Upperarm"] = 4,
- ["R Forearm"] = 5,
- ["R Hand"] = 6,
- ["L Thigh"] = 7,
- ["L Calf"] = 8,
- ["F Foot"] = 9,
- ["L Toe"] = 10,
- ["R Thigh"] = 11,
- ["R Calf"] = 12,
- ["R Foot"] = 13,
- ["R Toe"] = 14,
- ["Pelvis"] = 15,
- ["Spine"] = 16,
- };
- local hitscans = {0,16,4,1,5,2,6,3,15,11,7,12,8,13,9};
- /*if(settings["Aimbot"]["Hitbox"]) then
- if(settings["Aimbot"]["Hitscan"]) then settings["Aimbot"]["Hitscan"] = false; end
- local hBox = ent.GetHitBoxBone(v,0,0)
- if(!hBox) then return ent.OBBCenter(v); end
- local min,max = ent.GetHitBoxBounds(v,0,0);
- local hBoxPos = ent.GetBonePosition(v,hBox);
- if(!hBoxPos) then return ent.OBBCenter(v); end
- return (hBoxPos + (min + max) / 2);
- end*/
- local function getposition(v)
- if(settings["Aimbot"]["Body Aim"]) then
- local pos = ent.OBBCenter(v);
- if(!pos) then return; end
- return pos;
- end
- local pos, ang = ent.GetBonePosition(v,ent.GetHitBoxBone(v,0,0));
- finalpos = pos + ang:Forward() * 2;
- return finalpos;
- /*if(settings["Aimbot"]["Hitbox"]) then
- local bone = ent.GetBonePosition(v,0,0);
- local min,max = ent.GetHitBoxBounds(v,0,0);
- local aids;
- if(bone) then aids = bone + ((min + max) / 2); end
- if(IsVis(v,aids)) then return aids; end
- end
- if(!settings["Aimbot"]["Hitbox"] && !settings["Aimbot"]["Hitscan"]) then
- if(ent.LookupAttachment(v,"eyes") != 0) then
- local bone = ent.GetAttachment(v,ent.LookupAttachment(v,"eyes")).Pos;
- if(IsVis(v,bone)) then return bone; else return; end
- elseif (ent.LookupAttachment(ent,"forward") != 0) then
- local bone = ent.GetAttachment(v,ent.LookupAttachment(v,"forward")).Pos;
- if(IsVis(v,bone)) then return bone; else return; end
- else
- local pos = ent.OBBCenter(v);
- if(IsVis(v,pos)) then return pos; else return; end
- end
- end
- if(settings["Aimbot"]["Hitscan"]) then
- if(settings["Aimbot"]["Hitbox"]) then settings["Aimbot"]["Hitbox"] = false; end
- for k,_ in next, hitscans do
- local hScan = ent.GetHitBoxBone(v,hitscans[k],0);
- if(!hScan) then return ent.OBBCenter(v); end
- local hScanPos = ent.GetBonePosition(v,hScan);
- if(!hScanPos) then return ent.OBBCenter(v); end
- local min,max = ent.GetHitBoxBounds(v,hitscans[k], 0);
- if (IsVis(v, hScanPos + (min + max) / 2)) then
- return (hScanPos + (min + max) / 2);
- else
- return ent.OBBCenter(v);
- end
- end
- end*/
- end
- local bucket = {};
- local nullVel = Vector();
- local function getLagPred(v)
- if(!bucket[v]) then
- bucket[v] = {ent.GetVelocity(v), ent.GetPos(v), ent.GetVelocity(v), 0};
- return nullvec;
- end
- local oldVel = bucket[v][1];
- local oldPos = bucket[v][2];
- local newVel = ent.GetVelocity(v);
- local newPos = ent.GetPos(v);
- if(newVel != nullVel && newVel == oldVel && oldPos == newPos) then
- bucket[v][4] = bucket[v][4] + 1;
- local predVel = oldVel + oldVel * (bucket[v][4] * engine.TickInterval());
- predVel.z = 0;
- return predVel;
- else
- bucket[v] = {newVel, newPos, newVel, 0};
- return nullvec
- end
- end
- local function valid(v)
- if(!v || v == nil || !v:Alive() || !ent.IsValid(v) || v == me || ent.Health(v) < 1 || ply.Team(v) == 1002 || !IsVis(v,v:GetPos())) then return false; end
- if(settings["Aimbot"]["Ignore Spawn Protection"] && v:GetColor().a != 255) then return false; end
- if(settings["Aimbot"]["Ignore Bots"] && ply.IsBot(v)) then return false; end
- if(settings["Aimbot"]["Ignore Team"] && ply.Team(v) == ply.Team(me)) then return false; end
- if(settings["Aimbot"]["Ignore Friends"] && ply.GetFriendStatus(v) == "friend") then return false; end
- return true;
- end
- local function nextshot()
- aimtarget = nil;
- local allplys = player.GetAll();
- local avaib = {};
- for k,v in next,allplys do
- avaib[math.random(100)] = v;
- end
- for k,v in next, avaib do
- if(valid(v)) then
- aimtarget = v;
- end
- end
- end
- local function gettarget()
- for i = 1, #player.GetAll() do
- local v = player.GetAll()[i];
- if(!valid(v)) then aimtarget = v;
- break;
- end
- return aimtarget;
- end
- end
- hook.Add("Move","",function() if(!IsFirstTimePredicted()) then return; end servertime = CurTime(); end);
- function reg.Entity.FireBullets(p, data)
- local spread = data.Spread * -1;
- local class = p:GetActiveWeapon():GetClass();
- if(spread != cones[class] && spread != nullvec) then
- cones[class] = spread;
- end
- return(originalFire(p,data));
- end
- local function pSpread(userCmd, angle)
- local w = ply.GetActiveWeapon(me);
- if(!w || !ent.IsValid(w) || !cones[ent.GetClass(w)] || !settings["Misc"]["No Spread"]) then return angl.Forward(angle); end
- return(dickwrap.Predict(userCmd,angl.Forward(angle), cones[ent.GetClass(w)]));
- end
- local function canfire()
- local w = ply.GetActiveWeapon(me);
- if(!w || !em.IsValid(w)) then return true; end
- return(servertime >= wep.GetNextPrimaryFire(w));
- end
- local function shootable()
- local badweps = {"knife", "grenade", "ied", "bomb", "slam", "climb", "sword", "hand", "fist"};
- local w = ply.GetActiveWeapon(me);
- if(ent.IsValid(w)) then
- local n = string.lower(w:GetPrintName())
- if(w:Clip1() <= 0) then
- return false;
- end
- for k,v in next, badweps do
- if(string.find(n,k)) then return false;
- end
- return true;
- end
- end
- end
Add Comment
Please, Sign In to add comment