In my games, the leadeboard displays how many kills a player has, it also displays the total amount of kills, a team has. For example, this might be the case of a leaderboard:
Player
Kills
Team A
43
Player 1
40
Player 2
3
This always shows up, so I am wondering if there is a value assosicated with that, and if so, how can I obtain the team totals?
Maybe you only need to loop through every player from a team (I dont know how this works), I am going to show a way I think it would work.
local totalAmmount = 0
for i,v in pairs(team:GetPlayers()) do -- Loop through the team members
totalAmmount = totalAmmount + v.leaderstats.Points.Value
end
print(totalAmmount) --Prints how much points in the max that team has
local teamservice = game:GetService("Teams")
local team = Instance.new("Team", teamservice)
local totalkills = 0
for _, v in pairs(team:GetPlayers()) do
local killstat = v.leaderstats.Kills
totalkills += killstat.Value
end
print(totalkills)