public static LuaValue insert(LuaValue[] values) { LuaTable table = values[0] as LuaTable; if (values.Length == 2) { LuaValue item = values[1]; table.AddValue(item); } else if (values.Length == 3) { LuaNumber number = values[1] as LuaNumber; LuaValue item = values[2]; int index = (int)number.Number; table.InsertValue(index, item); } return(null); }