--Terrible aimbot by Jay. :D local shoot_nearest_player = CreateClientConVar("jhax_aimbot_nearest",0,true,false) local aimbot_enabled = CreateClientConVar("jhax_aimbot_enabled",1,true,false) local aimbot_bone = CreateClientConVar("jhax_aimbot_bone","head1",true,false) hook.Add("Think","JaysHacksAimbot",JaysHacksAimbot) function JaysHacksAimbot() local eyepos = LocalPlayer():EyePos() if(aimbot_enabled:GetInt() != 1)then return end --check if it's enabled, if not, disabled the whole function if(shoot_nearest_player:GetInt() != 1 && LocalPlayer():KeyDown(IN_ATTACK))then -- if we don't want to shoot the nearest player, snap to the person we're lookign at. local entity = LocalPlayer():GetEyeTrace().Entity if(entity:IsPlayer())then local bone = entity:LookupBone("ValveBiped.Bip01_"..aimbot_bone:GetString()) local bonepos,boneang = entity:GetBonePosition(bone) local angle = (bonepos - eyepos):Angle() LocalPlayer():SetEyeAngles(angle) end elseif(LocalPlayer():KeyDown(IN_ATTACK))then --snap to the nearest player, the attack check is very redundant but does it's job. local snapent = nil local last = nil for _,ply in pairs(player.GetAll())do --cycle through players to snap to local dist = LocalPlayer():GetPos():Distance(ply:GetPos()) if(ply != LocalPlayer())then if(snapent == nil || last == nil && ply)then -- if nothing exists, just snap to the first player, then cycle through snapent = ply last = dist elseif(dist < last && ply:Alive() && ply:GetFriendStatus() != "friend")then -- if the distance is less than the last checked player, snap to the nearest snapent = ply last = dist end end end if(snapent == nil)then return end --if they don't exist, end the function. local bone = snapent:LookupBone("ValveBiped.Bip01_"..aimbot_bone:GetString()) local bonepos,boneang = snapent:GetBonePosition(bone) local angle = (bonepos - eyepos):Angle() LocalPlayer():SetEyeAngles(angle) end end