I need to track the amount of people on teams to determine who wins the round, however it always says that there are zero people on the teams even if that isn't true. I double checked to make sure it was the correct colors for each team. These are not the names for the teams, however, just in case that might be the issue.
blue = 0
red = 0
while wait(1) do
for _,v in pairs(game.Players:GetChildren()) do
if v.TeamColor.Name == "Crimson" and v.Neutral == false then
red = red + 1
elseif v.TeamColor.Name == "Cyan" and v.Neutral == false then
blue = blue + 1
end
end
print("There are "..red.." players on the red team and "..blue.." players on the blue team.")
end
New script that comes 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

6 comments
Thank you, however, I added this: "if team.Name("Hiding").. #players > 0 then game.Workspace.HidingWinTest.Transparency = 0" and this error message came up "Workspace.HidingWin:6: attempt to call a string value" Do you know anything about this?
Oh its because your trying to compare a string
Edit your script so I can help
alr im guessing u mean i should edit the question
Edited
Please accept my answer