Solvedfov aimbot

Posts 1–2 of 2 · Page 1 of 1
fov aimbot
ay im new to lua coding and im just wondering how your supposed to make a aimbot with a fov.
Quote Originally Posted by time00 View Post
ay im new to lua coding and im just wondering how your supposed to make a aimbot with a fov.
Code:
local IgnoreTeam = true

function GetPos(ply)
return ply:GetAttachment(ply:LookupAttachment("forward")).Pos
end

function CheckVisible(ply)
local trc = {
start = LocalPlayer():GetShootPos(),
endpos = GetPos(ply),
filter = {ply,LocalPlayer()},
mask = MASK_SHOT
}

local trace = util.TraceLine(trc)
return trace.Fraction == 1
end

function GetPlayer(fov)
local ply = LocalPlayer()

for k,v in next, player.GetAll() do
if !v then continue end
if v == ply then continue end
if !v:IsPlayer() then continue end
if IgnoreTeam and (ply:Team() == v:Team()) then continue end
if v:InVehicle() then continue end
if !CheckVisible(v) then continue end
if v:Team() == TEAM_SPECTATOR then continue end
if 0 >= v:Health() then continue end
if !v:Alive() then continue end

local mang = ply:EyeAngles()
local tang = (v:GetPos() - ply:GetShootPos()):Angle()
if (math.AngleDifference(mang.x, tang.x) + math.AngleDifference(mang.y, tang.y)) > fov then continue end
return v
end
return nil
end
idk if it works, i coded it on the spot in a minute so have fun
Posts 1–2 of 2 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us