I used that script on a brick but it didn't work:
script.Parent.Touched:connect(function(hit) Local player = hit.Parent.Name game.Players.player.Team = LabLabLab --Lol
"connect" is deprecated, player.Team requires an object, and game.Players.Player would be an object when the variable player is simply a string
(saw a comment after posting, edited to use more reliable method)
script.Parent.Touched:Connect(function(hit) local user = game.Players:GetPlayerFromCharacter(hit.Parent) user.Team = game:GetService('Teams'):FindFirstChild('Team1') end)