--Script Under my GUI
local textlabel = script.Parent
local function TeamKills(teamName)
local allKills = 0
for _, player in ipairs(game.Players:GetPlayers()) do
if player.Team and player.Team.Name == teamName and player.leaderstats then
allKills = allKills + player.leaderstats.Kills.Value
end
end
return allKills
end
local Team = "Alpha"
while true do
textlabel.Text = TeamKills(Team)
wait(.1)
end
As you can see, this is to display the stats of the leaderboard on a Textlabel
Imagine this
Team “Alpha” needs 20 kills to win, and is at 19 kills.
Suddenly, a player on team alpha with 4 kills disconnects and now the team has 15 kills, and loses the game because of this.
What I want to happen is that even when said player leaves, the value remains as is, and can just keep going
because of this, Team “Alpha” can still win with just one more kill because they didn’t lose 4 points when one of their players left.
Can someone please explain to me to achieve this?