I'd like to make a tool that gets every possible key and their values from the shot entity and then list them to log. How I do it?
Ideal code:
[lua]
function TOOL:LeftClick(tr)
if tr.Hit and tr.Entity and tr.Entity:IsValid() then
local key = "something"
local value = tr.Entity:GetKeyValues().key
Msg( "test " .. tostring(key) .. "\n" .. tostring(value) .. "\n")
return true
end
end
[/lua]
PrintTable(tr.Entity:GetKeyValues()) ?
[QUOTE=jimbodude;32149700]PrintTable(tr.Entity:GetKeyValues()) ?[/QUOTE]
Works fine, thank you.
Is there a way to get all outputs too? (They are set by Hammer)
Sorry, you need to Log In to post a reply to this thread.