for index,contestant in pairs(contestants) do
local total = 0
local plrs = 0
for i,v in pairs(globalData) do
if not excluded[tostring(v["ID"])] then
local individualRating = v["Ratings"][index]
if individualRating then
total = total+individualRating
plrs+=1
end
end
end
local average = total/plrs
ratings[contestant["Name"]] = {
["Score"] = average,
["ID"] = contestant["UserId"]
}
end
table.sort(ratings, function(a,b) return a.Score > b.Score end)
print(ratings)