a friend recently asked me on how to print the material from specific “toolgun outputs”, like rope, elastics and stuff, into the console or a file. The way on how to this has recently bothered me alot. This is how far I’ve gotten.
I tried to do this:
for k, v in pairs(ents.GetAll()) do if ( v:GetClass() == "class_C Rope") then MsgN(v:GetMaterial()) end end
(also tried class c_RopeKeyFrame)
things print blank into the console. Nothing else, really.
Tried GetTable and GetSaveTable, but it just returns the classes.
Tried to do
hook.Add('OnEntityCreated','fdf', function(ent) PrintTable(ent:GetKeyValues()) end)
and it returns this:
Nothing useful for what I can see.
If the Rope Tool’s code is interesting to anyone, here it is:
I don’t think it’s impossible to get the material of a spawned rope, does anyone have a clue?