✓ Accepted answer
The problem here is precedence.
or is the lowest precedence, meaning the expression is interpreted as
( player.Name .. "=" .. ds:GetAsync(player.userId) ) or 0
You just need explicit parenthesis:
player.Name .. "=" .. (ds:GetAsync(player.userId) or 0)
The error should have hinted this -- it said you're concatenating nil. Concatenating is the .. operator; the only thing near a .. that could be nil is ds:GetAsync.
Aside: This isn't a dictionary. This is a list.
You should consider using table.insert instead of tab[#tab]. You also really shouldn't use the variable name table, because it will cover up the table library and maybe mess you up later.
1 comment
http://wiki.roblox.com/index.php?title=Table.insert#table.insert That should help