I have been trying to make a win value which doesn’t be in the leaderboard on the GUI which shows all the players, I have tried to make it give a win to the winning team but it ends up giving everyone the win
function GiveWins(team, amount)
for _, player in pairs(team:GetPlayers()) do
print(player.Parent.Parent)
if player.Team == team then
player.Parent.Parent.ReplicatedStorage.leaderstats.Wins.Value = player.Parent.Parent.ReplicatedStorage.leaderstats.Wins.Value + 1
end
end
end
local function GiveTeamWins(TeamName,Amount)
for _,player in pairs(game.Players:GetChildren()) do
if player.Team.Name == TeamName then
player.leaderstasts.Wins.Value += Amount
end
end
end
local Players = game:GetService("Players")
local Teams = game:GetService("Teams")
local function GiveTeamStats(Team:Team,Amount:number)
for _,player in pairs(Players:GetPlayers()) do
if player.Team == Teams:FindFirstChild(Team) then
player.leaderstasts.Wins.Value += Amount
end
end
end
function GiveWins(team, amount)
local teams = {["a"]=Color3.FromRGB(255,255,255),["b"]=Color3.FromRGB(0,0,0)}
for _, player in pairs(team:GetPlayers()) do
if player.TeamColor == teams[team] then
player.leaderstats.Wins.Value += amount
print(player.Name .. " now have " .. player.leaderstats.Wins.Value .. " Wins.")
end
end
end
function GiveWins(team, amount)
for _, player in pairs(team:GetPlayers()) do
print(player.Parent.Parent)
if player.Team == team then
player.Parent.Parent.ReplicatedStorage.leaderstats.Wins.Value = player.Parent.Parent.ReplicatedStorage.leaderstats.Wins.Value + 1 -- Replicated storage is in the game correct? so why use player.Parent.Parent? just do game.ReplicatedStorage.
end
end
end
function GiveWins(team, amount)
for _, player in pairs(team:GetPlayers()) do
print(player.Parent.Parent)
if player.Team == team then
game.ReplicatedStorage.leaderstats.Wins.Value += 1
end
end
end