Hi. How would I make a dynamic GUI team counter which changes when a player leaves, dies/resets, changes teams or joins?
I don't know how to use the Changed event in order to change the counter number. Do I use the PlayerRemoving Event?
I got this in mind but I don't think it'll work.
while wait() do
for i, v in next, game.Players:GetPlayers() do
if v.TeamColor == "Bright red" then
script.Parent.reds.Value = script.Parent.reds.Value + 1
elseif v.TeamColor == "Bright blue" then
script.Parent.blues.Value = script.Parent.blues.Value+1
elseif v.TeamColor == "White" then
script.Parent.whites.Value = script.Parent.whites.Value + 1
end
end
end

1 comment
Thank you!