print(#tile.inputs)
for i, v in pairs(tile.inputs) do
self:disconnectWire(tile, v, true)
print(#tile.inputs)
end
Now here is the problem, whenever it originally prints the length of the tile.inputs table (at the top) it says two. Then whenever it prints the length of the tile.inputs table (in the loop) it says one. Though the loop does not continue after that. Whenever I comment the self:disconnectWire(tile, v, true) line, the loop continues fine. Though it should happen even when it is not commented because there is still one instance left in the table.
pairs is not ordered, meaning it will iterate over the tile.inputs table in whatever order it pleases; depending on what disconnectWire does, it might mess with iteration.
either try using ipairs, or if that doesn't work either (probably due to you deleting entries in the tile table), then do a simple for loop, and iterate backwards.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.