In my function to find the mvp, the function only gets the points of the first player to join can anyone help me?
function findMVP()
local allStats = {}
for _,players in pairs(game.Players:GetChildren()) do
if players.IsPlayerInRound.Value == true then
table.insert(allStats,players.Name..' has won with '..players.leaderstats.Points.Value..' points!')
table.sort(allStats,function(x,y) return x > y end)
for _,stats in pairs(allStats) do
print(stats)
end
return allStats[1]
else
print(players.Name.." isn't in the round!")
end
end
end

1 comment
Try GetPlayers() instead