Hey I have been tinkering with a small lua project that has turned into one nasty problem. I am trying to make a client-side lua code that, when my health is lowered, does an aim trace on every player in the server, looking for if the trace returns an entity that is the same as LocalPlayer().
Now all of my logic works, and I have tested it. I run into my issue with the fact that the trace for the player that shot me ALWAYS goes through me, like it is filtering LocalPlayer() by default. Is there any way to remove this filter? For my trace I am using:
[code]
local trace = {}
trace.start = v:GetShootPos()
trace.endpos = v:GetShootPos() + (v:GetAimVector()*16000)
trace.filter = v
local traceRes = util.TraceLine( trace )
[/code]
where v is each cycled player in player.GetAll().
It does the traces correctly for anything that is not hitting my player entity; any traces that are hitting my player entity go right though and hit the thing behind me.
Any help?
Sorry, you need to Log In to post a reply to this thread.