I was wondering if it was possible to iterate though multiple tables within one loop for example:
local Tab = {"Test1","Test2"} local Tab2 = {"Test4","Test5"}
for _,v in pairs(Tab,Tab2) do print(v) end
It only prints the first indexed table? is this something that can be done? or do the tables need to be Iterated through separate loops?
No, you cannot. Though you can nest another Loop for every traversed Element in table1. So for this example I’m going to singularly check for every Users UserId is the UserId special to theirs. (May not make entire sense, though the Code should enforce my example)
local UserIds = {74087102, 72209828}; local Users = game:GetService("Players"):GetPlayers for i = 1,#UserIds do for j = 1,#Users do if (User[j].UserId == UserIds[i]) then print(User[i].Name.." Is here!") end end end
Hope this helps! P.S: You can find a more significant use of this, and it will come in handy in certain scenarios!