Index for Constraints?

Is there any way of finding which Constraint was spawned first. Some sort of index or id? I tried to use EntIndex() for the constraints but it just keeps outputting 0 so I guess they dont get kept in the same order as props.

[lua]
local con = constraint.FindConstraints( ent, “Rope” )
for i = 1, #con do
print(con*)
end
if( con[1] ) then con[1]:Remove() end
[/lua]
Maybe that? I’ve never bothered to work with constraints in lua, so it might not work.

That doesn’t get what order it was made in. If I have like 10 entities how would I see which one has the first, second, third created constraint.

The later the ent spawned, the higher the EntIndex will be.

@_Undefined Yes this is true which is why I need one for constraints, but EntIndex() doesn’t work for constraints.

When something is put into a table without a given index, the table sets on automatically, so the first thing will be 1, next 2, next 3 where 1 = 1st, unless constraints actually use an index, like i said i havent bothered to work with constraints in lua.

So in my snippet, con[1] = the first constraint. Where con[2] = the 2nd

Yeah but if you have like 20 props with welds and stick all of the welds into one table, using that doesn’t stick them in the order they were created. I made my own Index for them though, its working for now, but i fear it will be buggy for what I will be using it for.