Field Of Vision "sense"

Remember those old 2d sneak games where you can see the “bad guy’s” field of vision as a cone? I think a client-side script that draws a square box of a cone that approximates other player’s field of view would be kinda cool. (Draw from eyes using their viewangle).

This would make being sneaky really fun, since you could get past people without them seeing you using your “ninja sense.”

nBot has something like that.

I had no one to test it on but no errors came out of it so it should work, ripped out of nBot
concommand.Add(“mgsview”, function()
for k, ply in pairs(player.GetAll()) do
if ply:Alive() and !ply == LocalPlayer() then
local frwrd = (ply:EyePos() + (ply:GetAimVector() * 200)):ToScreen()
local eyeone = ply:GetBonePosition(ply:LookupBone(“ValveBiped.Bip01_Head1”)):ToScreen()
local eyetwo = ply:GetBonePosition(ply:LookupBone(“ValveBiped.Bip01_Pelvis”)):ToScreen()
surface.SetDrawColor( 255, 10, 25, 255 )
surface.DrawLine( eyeone.x, eyeone.y, eyetwo.x, eyetwo.y)
surface.DrawLine( eyeone.x, eyeone.y, frwrd.x, frwrd.y)
surface.DrawLine( eyetwo.x, eyetwo.y, frwrd.x, frwrd.y)
end )