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.
01 | for i, v in pairs (Players:GetChildren()) do |
02 | if v:IsA( "Player" ) then |
03 | lowertext.Text = v.Team.Name |
04 | v.Team:GetPropertyChangedSignal(v.Team):Connect( function () |
05 | for i, v in pairs (Players:GetChildren()) do |
06 | if v:IsA( "Player" ) then |
07 | lowertext.Text = v.Team.Name |
08 | end |
09 | end |
10 | end ) |
11 | end |
12 | 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.
1 | for i, v in pairs (Players:GetPlayers()) do |
2 | v.Team.Changed:Connect( function () |
3 | lowertext.Text = v.Team.Name |
4 | end ) |
5 | 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 ;)