So, this may be a terrible terrible setup because its my first time trying one. But I am trying to do map voting and when the player votes their userId gets added to a table with the map they voted. and to get the frequency I tried doing this
local function countFreq(tab)
local freq = {};
for _, v in ipairs(tab) do
freq[v] = (freq[v] or 0) + 1;
end
return freq;
end
Always returns nil even if there is votes, and or duplicate votes.

8 comments
have you tried printing freq[v] after you changed it
also semicolons aren't needed in roblox lua
also what s the table "tab" supposed to contain?
Holy illiterate.
semicolons why
people who use semicolons > skrubs with spaghetti code ????
thats just an excess burden though
How, the semicolon is literally right next to shift it takes no extra work to press. Other languags I program in require it and I think Lua is more readable with it