You define T as a name, but you use it as a function (line 4).
Properly, it's probably either the team object itself (without the name) or just the name. It might be better to use the Team object itself in case later you wanted to get more information (like the color).
I'm assuming this is in a TextLabel in the StarterGui (PlayerGui).
In that case, the Parent of the TextLabel is probably a ScreenGui, and its parent is probably the PlayerGui; its parent is the Player.
Players are not children of their respective teams - they are children of the Players service.
You figure out which team they are on by matching their TeamColor to a Team object's team color:
player = script.Parent.Parent.Parent.Parent
teamColor = player.TeamColor
allTeams = game:GetService("Teams"):GetChildren()
for _, team in pairs( allTeams) do
if team.TeamColor = teamColor then
myTeam = team
end
end
myTeam now refers to the player's team.
When we set Text, we remember that Text is a string. "Your Team: " is a string. It is not a UDim2.
script.Parent.Text = "Your Team: " .. myTeam.Name
2 comments
You need to slow down. WHY are you putting each word of this script down? Throwing things down that "look" like Lua is NEVER a way to write a script.
Yeah I really need more practice. :l