Advertisement
Guest User

Untitled

a guest
Nov 30th, 2015
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. CreateClientConVar("zmod_aimbot", 0, false, false)
  2.  
  3. function aimbot() -- Starting the function
  4. if target!= nil and target:IsValid() and target:IsPlayer() then
  5. local targethead = target:LookupBone("ValveBiped.Bip01_Head1")
  6. local targetheadpos,targetheadang = target:GetBonePosition(targethead)
  7. LocalPlayer():SetEyeAngles((targetheadpos - LocalPlayer():GetShootPos()):Angle()) -- And finally, we snap our aim to the head of the target.
  8. end
  9. local ply = LocalPlayer()
  10. local trace = util.GetPlayerTrace( ply )
  11. local traceRes = util.TraceLine( trace )
  12. if target != nil and target:Alive() and !target:InVehicle() and VisiblePly(target) and target:Team() != TEAM_SPECTATOR then
  13. else
  14. target = nil
  15. lock = false
  16. end
  17. if traceRes.HitNonWorld and traceRes.Entity:IsPlayer() and !lock then
  18. target = traceRes.Entity
  19. lock = true
  20. end
  21. end
  22. hook.Add("Think","aimbot",aimbot) -- The hook will spam "aimbot" until it finds a target..
  23.  
  24. function VisiblePly(ent)
  25. local pos = LocalPlayer():GetShootPos()
  26. local ang = LocalPlayer():GetAimVector()
  27. local trace = {start = LocalPlayer():GetShootPos(), endpos = ply:GetShootPos(ent), filter = {LocalPlayer(), ent}, mask = 1174421507};
  28. local tr = util.TraceLine(trace);
  29. return(tr.Fraction == 1);
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement