function getTopThree()
sortedTable = {}
for player,damage in pairs(damageTable) do
if isElement(player) then
local team = getPlayerTeam(player)
table.insert(sortedTable, {player, damage})
end
end
table.sort(sortedTable, function(a,b) return a[2] > b[2] end)
local t1, t2, t3 = {}, {}, {}
t1 = {getPlayerName(sortedTable[1][1]), sortedTable[1][2]} or {"N/A", "0"}
t2 = {getPlayerName(sortedTable[2][1]), sortedTable[2][2]} or {"N/A", "0"}
t3 = {getPlayerName(sortedTable[3][1]), sortedTable[3][2]} or {"N/A", "0"}
triggerClientEvent(root, "showTopZDamage", root, t1, t2, t3)
end
i have a problem on when i want to get t2 and t3 because there's no player
" attempt to index field '?' ( a nil value ) "