Hello, I can’t find any post on this subject, which is why I am posting this.
How do you get every players leaderstat (such as their money) and combine all of them into 1 value? I am trying to get the server’s total money and put it on a sign.
local aggregate = 0
while task.wait(10) do
for i,v in ipairs(game:GetService('Players'):GetChildren()) do
aggregate += v.leaderstats.Money.Value -- Replace Money with whatever stat you want
end
-- Change the text of whatever TextLabel you want to change to the aggregate
end
1 Like
This will just keep counting up? You need to reset it everytime, or just define it in the beginning of the while loop.
1 Like