Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you do a for i, v in pairs reversed?

Asked by 3 years ago

Ok, so I use for i, v in pairs(T) quite a bit. But what if I want to reverse the order? Can you add a step in the pairs loop, or a negative step?

0
You could do (#T-i)+1 I think sngnn 274 — 3y
0
I can't seem to figure out the pairs equivalent, i tried some variations of that, but for now, I just went with a generic index iterator: `` for i = #bl, 1, -1 do; v = tbl[i]; end BloxSlot 0 — 3y

Answer this question