So what I'm trying to do is make the variable 'lowertext' the player's current team name. But for some reason, when a player changes team, it doesn't change the name tag text. Someone please help, this has been annoying me for a while now lol.
for i, v in pairs(Players:GetChildren()) do if v:IsA("Player") then lowertext.Text = v.Team.Name v.Team:GetPropertyChangedSignal(v.Team):Connect(function() for i, v in pairs(Players:GetChildren()) do if v:IsA("Player") then lowertext.Text = v.Team.Name end end end) end end
Though I would recommend a Changed
event, this for loop is running only once. It needs to run more than once to work. A while wait() do
should do the trick.
for i, v in pairs(Players:GetPlayers()) do v.Team.Changed:Connect(function() lowertext.Text = v.Team.Name end) end
There are many errors in your code and I'm lazy to state all error so here is the fixed code, if its not working feel free to ask me ;)