Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CreateClientConVar("zmod_aimbot", 0, false, false)
- function aimbot() -- Starting the function
- if target!= nil and target:IsValid() and target:IsPlayer() then
- local targethead = target:LookupBone("ValveBiped.Bip01_Head1")
- local targetheadpos,targetheadang = target:GetBonePosition(targethead)
- LocalPlayer():SetEyeAngles((targetheadpos - LocalPlayer():GetShootPos()):Angle()) -- And finally, we snap our aim to the head of the target.
- end
- local ply = LocalPlayer()
- local trace = util.GetPlayerTrace( ply )
- local traceRes = util.TraceLine( trace )
- if target != nil and target:Alive() and !target:InVehicle() and VisiblePly(target) and target:Team() != TEAM_SPECTATOR then
- else
- target = nil
- lock = false
- end
- if traceRes.HitNonWorld and traceRes.Entity:IsPlayer() and !lock then
- target = traceRes.Entity
- lock = true
- end
- end
- hook.Add("Think","aimbot",aimbot) -- The hook will spam "aimbot" until it finds a target..
- function VisiblePly(ent)
- local pos = LocalPlayer():GetShootPos()
- local ang = LocalPlayer():GetAimVector()
- local trace = {start = LocalPlayer():GetShootPos(), endpos = ply:GetShootPos(ent), filter = {LocalPlayer(), ent}, mask = 1174421507};
- local tr = util.TraceLine(trace);
- return(tr.Fraction == 1);
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement