[gamemodes\perp\gamemode\sv_modules\setup_map.lua:352] attempt to call method 'GetEyeTrace' (a nil value)
Can anyone help me ill post the code below i dont know how to fix it.
[CODE]function GM.GetTracePos ( Player )
if !Player:IsSuperAdmin() then return false; end
local Eyes = Player:GetEyeTrace().HitPos;
Player:PrintMessage(HUD_PRINTCONSOLE, 'Vector(' .. math.Round(Eyes.x) .. ', ' .. math.Round(Eyes.y) .. ', ' .. math.Round(Eyes.z) .. ')\n');
end
concommand.Add('perp_get_trace_pos', GM.GetTracePos);
[/CODE]
Player appears to not be a player try print(Player) and see what it is or the meta table got overwritten.
[QUOTE=-TB-;32735554]Player appears to not be a player try print(Player) and see what it is or the meta table got overwritten.[/QUOTE]
If it wasn't a player it would already error at IsSuperAdmin except IsSuperAdmin is defined in the _R.Entity table which I highly doubt.
Use TraceLine
[b][url=http://wiki.garrysmod.com/?title=Util.TraceLine]Util.TraceLine [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]
so how would i make this work using Util.TraceLine ive never used it before. so im just curious
Sorry, you need to Log In to post a reply to this thread.