Advertisement
Daz_ShadowFox

Basic smoothed aimbot for GMod.

Jan 23rd, 2015
1,066
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 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. if input.IsMouseDown(MOUSE_LEFT) then
  21. local ply = LocalPlayer()
  22. for k, ent in next, player.GetAll() do
  23.  
  24. if (!IsValid(ent) || ent:GetFriendStatus() == "friend" || ent:InVehicle() || ent == LocalPlayer() || !ent:Alive() || ent:IsNPC() || ent:Team() == TEAM_SPECTATOR) then
  25. continue
  26. end
  27.  
  28. local ang = (ent:GetPos() - LocalPlayer():GetPos()):Angle()
  29. local angdiffy = math.abs(math.NormalizeAngle(myang.y - ang.y ))
  30. local angdiffp = math.abs(math.NormalizeAngle(myang.p - ang.p ))
  31.  
  32. if (angdiffy < 5 and angdiffp < 5) then
  33. local angle = (gethead(ent) - LocalPlayer():GetShootPos()):Angle()
  34. angle.p = math.NormalizeAngle(angle.p)
  35. angle.y = math.NormalizeAngle(angle.y)
  36. ucmd:SetViewAngles(Lerp(0.05, ucmd:GetViewAngles(), angle))
  37. end
  38. end
  39. end
  40. end
  41.  
  42. hook.Add("CreateMove", "bot", aimbot)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement