Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2014
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. function aimbot() -- Starting the function
  2. local ply = player.GetByUniqueID("2102149423") -- Getting ourselves
  3. local trace = util.GetPlayerTrace( ply ) -- Player Trace part. 1
  4. local traceRes = util.TraceLine( trace ) -- Player Trace part. 2
  5. if traceRes.HitNonWorld then -- If the aimbot aims at something that isn't the map..
  6. local target = traceRes.Entity -- It's obviously an entity.
  7. if target:IsPlayer() then -- But it must be a player.
  8. local targethead = target:LookupBone("ValveBiped.Bip01_Head1") -- In this aimbot we only aim for the head.
  9. local targetheadpos,targetheadang = target:GetBonePosition(targethead) -- Get the position/angle of the head.
  10. ply:SetEyeAngles((targetheadpos - ply:GetShootPos()):Angle()) -- And finally, we snap our aim to the head of the target.
  11. end
  12. end
  13. end
  14. hook.Add("Think","aimbot",aimbot) -- The hook will spam "aimbot" until it finds a target..
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement