Hi, when i update the table by the function AddDamage the table is update same if i put a print in the module but the function GetDamageList return an empty table whereas if i update damage by AddDamage the table is remembering the last update so i don't know why its not working :
local module = {}
local damagelist = {}
function module.AddDamage(player : Player, damage : NumberValue)
if damagelist[player] then
damagelist[player] += damage
else
damagelist[player] = damage
end
print(damagelist)
end
function module.RefreshDamage()
table.clear(damagelist)
end
function module.GetDamageList()
table.sort(damagelist)
return damagelist
end
return module