I need to track the amount of players per team to determine who wins. I was given this script by another user
local teams = game:GetService("Teams"):GetTeams()
for _, team in pairs(teams) do
local players = team:GetPlayers()
print("Team " .. team.Name .. " has " .. #players .. " players")
end
and it worked just fine. However, when I tried to add an if ten statement it came up with this error message: Workspace.HidingWin:6: attempt to call a string value
local teams = game:GetService("Teams"):GetTeams()
for _, team in pairs(teams) do
local players = team:GetPlayers()
print("Team " .. team.Name .. " has " .. #players .. " players")
if team.Name("Hiding").. #players > 0 then
game.Workspace.HidingWinTestA.Value = true
end
end
How can I fix this?

1 comment
This should work.