So I made this team counter for my game. but I want it to display on the television so I made a surface GUI and a few text labels with each team. This is the script I wrote:
local RedTeam = game.Teams.Red:GetPlayers()
local BlueTeams = game.Teams.Blue:GetPlayers()
while true do
wait(0.1)
script.Parent.RedTeam.Text = "Red " .. #RedTeam
script.Parent.BlueTeam.Text = "Blue " .. #BlueTeams
end
But it doesn’t seem to show on the Surface Thing. Here is a video:
The amount would never update, try only defining the team and not the amount of players in the team.
local RedTeam = game.Teams.Red
local BlueTeam = game.Teams.Blue
while true do
wait(0.1)
script.Parent.RedTeam.Text = "Red " .. #RedTeam:GetPlayers()
script.Parent.BlueTeam.Text = "Blue " .. #BlueTeam:GetPlayers()
end