Hey guys. Well i know how to do HUD and everything else but what i need help with is having it recognize if the player is looking at the entity “treasure”.
[lua]
local pos = LocalPlayer():GetShootPos()
local ang = LocalPlayer():GetAimVector()
local tracedata = {}
tracedata.start = pos
tracedata.endpos = pos+(ang*150)
tracedata.filter = LocalPlayer()
local trace = util.TraceLine(tracedata)
[/lua]
That is the code i use to get what the player is looking at. Again, what I’m trying to figure out is how to make it recognize if it is looking at the entity “treasure”.
Thanks =)