For the issues you've come across, it may be a little hard to explain through words alone. So, I took the liberty of showing you the process that's occurring during the iteration of workspace, through some debug statements.
local workspace = {1,2,"Hello", "there", "I'm", "Feahren",3,4}
local tab = {}
for i,v in pairs(workspace) do
print("Index: "..i.." Value: "..v.." Table Length: "..#tab)
tab[#tab+5] = v
print(tab[i])
end
After applying the lines to help us parse the data, I was given these results. Let's take a look.
Index: 1 Value: 1 Table Length: 0
nil
Index: 2 Value: 2 Table Length: 0
nil
Index: 3 Value: Hello Table Length: 0
nil
Index: 4 Value: there Table Length: 0
nil
Index: 5 Value: I'm Table Length: 0
I'm
Index: 6 Value: Feahren Table Length: 0
nil
From analyzing the data, It's conclusive that all values except with pardon from the fifth index in workspace, is not approved. All the while showing that the table length, even afterwards, remains 0; this is why the for i loop isn't functioning, because the iteration input translates to the following:
for i = 1,0 do
Conclusion
From what I've been able to gather, using the syntax tab[#tab+5], it appears to create a reserved slot within the table at the specified numerical index, look it like this:
tab[#tab+a] a as the reserve point.
Altogether—due to the restrictive principles that follow with said syntax—all other processed values will be forced to be stored within the reserved slot, causing them to overlap and override, until the final value is iterated, which will be the static result.
I hope this explains everything, and that you understood everything I talked about, if you have any further questions, don't be afraid to ask. However, all I can say is that, to fix your issue, you must simply use another form of referencing the placement of the iterated values from workspace to tab.