Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2015
2,570
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.34 KB | None | 0 0
  1. --[[
  2.  
  3. A simple legit looking smooth aimbot using LerpAngle written by BigDazGuy666
  4.  
  5. Thanks to:
  6. Flapadar
  7.  
  8. ]]
  9.  
  10. local function gethead(ent)
  11.     if ent:LookupBone("ValveBiped.Bip01_Head1") then
  12.     local pos = ent:GetBonePosition(ent:GetHitBoxBone(0, 0))
  13.         return pos
  14.     end
  15.     return ent:LocalToWorld(ent:OBBCenter())
  16. end
  17.  
  18. local function aimbot(ucmd)
  19.     local myang = LocalPlayer():GetAngles() //FOV checks are borrowed from FapHack
  20.    
  21.     if input.IsMouseDown(MOUSE_LEFT) or aim == true then
  22.         local ply = LocalPlayer()
  23.         local target = nil;
  24.         for k, ent in next, player.GetAll() do
  25.             if (!IsValid(ent) || ent:GetFriendStatus() == "friend" || ent:InVehicle() || ent == LocalPlayer() || !ent:Alive() || ent:IsNPC() || ent:Team() == TEAM_SPECTATOR) then
  26.                 continue
  27.             end
  28.  
  29.             local ang = (ent:GetPos() - LocalPlayer():GetPos()):Angle()
  30.             local angdiffy = math.abs(math.NormalizeAngle(myang.y - ang.y ))
  31.             local angdiffp = math.abs(math.NormalizeAngle(myang.p - ang.p ))
  32.        
  33.             if (angdiffy < 5 and angdiffp < 5) then
  34.                 target = ent
  35.             end
  36.         end
  37.         if (target != nil) then
  38.             local angle = (gethead(target) - LocalPlayer():GetShootPos()):Angle()
  39.             angle.p = math.NormalizeAngle(angle.p)
  40.             angle.y = math.NormalizeAngle(angle.y)
  41.             ucmd:SetViewAngles(Lerp(0.05, ucmd:GetViewAngles(), angle))
  42.         end
  43.     end
  44. end
  45.  
  46. hook.Add("CreateMove", "bot", aimbot)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement