So... this trace isn't detecting the player.. odd.. Help is appreciated. Oh and I'm doing this all clientside:
[lua]
hook.Add( "KeyPress", "UnderDonePlayerUseMenu", function( player, key )
if key == IN_USE then
local _t = {}
_t.start = player:GetShootPos()
_t.endpos = player:GetShootPos() + player:GetAimVector() * 80
_t.filter = player
if _t.HitNonWorld and _t.Entity:IsPlayer() then
local target = _t.Entity
RunConsoleCommand( "ud_playerusemenu", target:EntIndex() )
end
end
end )
[/lua]
Thanks guys :D
You didn't actually run the trace.
What are you trying to do with this? If I'm not mistake _t.HitNonWorld and _t.Entity aren't defined. You might want to use this.
[b][url=http://wiki.garrysmod.com/?title=Player.GetEyeTrace]Player.GetEyeTrace [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]
[QUOTE=sintwins;21228056]What are you trying to do with this? If I'm not mistake _t.HitNonWorld and _t.Entity aren't defined. You might want to use this.
[b][url=http://wiki.garrysmod.com/?title=Player.GetEyeTrace]Player.GetEyeTrace [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b][/QUOTE]
Kogitsune already his problem. He needs to put util.TraceLine or something in there after he makes the tracedata table.
Yeah, kogitsune got there first :(
Thanks, I can't believe I forgot that..
Sorry, you need to Log In to post a reply to this thread.