for _, player in pairs(game:GetService('Players'):GetPlayers()) do
if player:IsA('Player') then
if player:FindFirstChild('leaderstats', false) then
local leaderstats = player:FindFirstChild('leaderstats', false)
if leaderstats:IsA('Folder') then
if leaderstats:FindFirstChild('Kills', false) then
local kills_val = leaderstats:FindFirstChild('Kills', false)
if kills_val:IsA('ValueBase') then
kills_val:GetPropertyChangedSignal('Value'):Connect(function()
if player.Team == game:GetService('Teams'):FindFirstChild('Blue', false) then --// Enter your team name here
script.Parent:FindFirstChild('BlueTeamFrame', false):FindFirstChild(player.Name, false):FindFirstChild('Kills', false).Text = tostring(kills_val.Value)
elseif player.Team == game:GetService('Teams'):FindFirstChild('Green', false) then --// Enter your team name here
script.Parent:FindFirstChild('GreenTeamFrame', false):FindFirstChild(player.Name, false):FindFirstChild('Kills', false).Text = tostring(kills_val.Value)
end;
end);
end;
end;
end
end;
end;
end;
put this in a script directly under the Ui instance
for _, player in pairs(game:GetService('Players'):GetPlayers()) do
if player:IsA('Player') then
if player:FindFirstChild('leaderstats', false) then
local leaderstats = player:FindFirstChild('leaderstats', false)
if leaderstats:IsA('Folder') then
if leaderstats:FindFirstChild('Kills', false) then
local kills_val = leaderstats:FindFirstChild('Kills', false)
if kills_val:IsA('ValueBase') then
kills_val:GetPropertyChangedSignal('Value'):Connect(function()
if player.Team == game:GetService('Teams'):FindFirstChild('Blue', false) then --// Enter your team name here
tonumber(script.Parent:FindFirstChild('BlueTeamFrame', false):FindFirstChild(player.Name, false):FindFirstChild('Kills', false).Text) += tonumber(kills_val.Value)
elseif player.Team == game:GetService('Teams'):FindFirstChild('Green', false) then --// Enter your team name here
tonumber(script.Parent:FindFirstChild('GreenTeamFrame', false):FindFirstChild(player.Name, false):FindFirstChild('Kills', false).Text) += tonumber(kills_val.Value)
end;
end);
end;
end;
end
end;
end;
end;
for _, player in pairs(game:GetService('Players'):GetPlayers()) do
if player:IsA('Player') then
if player:FindFirstChild('leaderstats', false) then
local leaderstats = player:FindFirstChild('leaderstats', false)
if leaderstats:IsA('Folder') then
if leaderstats:FindFirstChild('Kills', false) then
local kills_val = leaderstats:FindFirstChild('Kills', false)
if kills_val:IsA('ValueBase') then
kills_val:GetPropertyChangedSignal('Value'):Connect(function()
if player.Team == game:GetService('Teams'):FindFirstChild('Blue', false) then --// Enter your team name here
script.Parent:FindFirstChild('BlueTeamFrame', false):FindFirstChild(player.Name, false):FindFirstChild('Kills', false).Text = tonumber(script.Parent:FindFirstChild('BlueTeamFrame', false):FindFirstChild(player.Name, false):FindFirstChild('Kills', false).Text) + tonumber(kills_val.Value)
elseif player.Team == game:GetService('Teams'):FindFirstChild('Green', false) then --// Enter your team name here
script.Parent:FindFirstChild('GreenTeamFrame', false):FindFirstChild(player.Name, false):FindFirstChild('Kills', false).Text = tonumber(script.Parent:FindFirstChild('GreenTeamFrame', false):FindFirstChild(player.Name, false):FindFirstChild('Kills', false).Text) + tonumber(kills_val.Value)
end;
end);
end;
end;
end
end;
end;
end;
That code should also work if your teams are greater than 1 per, it should just add the value to the current value. NOW that I think of it. You should probably change.
to just 1 because otherwise it’ll start adding 15 per then 16 per instead of counting up by one.