This is a server script that is inside a part which is inside a tool. I don't know why this doesn't work. What the tool does it when it's touched, it would respawn the player but before that, it would set their team to "Waiting". The error I get in the output is:
19:01:36.841 - Team is not a valid member of Model 19:01:36.842 - Stack Begin 19:01:36.843 - Script 'Players.Player1.Backpack.Shark Tagger.Handle.Script', Line 7 19:01:36.845 - Stack End
local teams = game:GetService("Teams")
local lobby = teams:WaitForChild("Waiting")
function touched(hit)
local players = game.Players:GetPlayerFromCharacter(hit.Parent)
if hit.Parent:findFirstChild("Humanoid") then
players.TeamColor = lobby.TeamColor
end
end
script.Parent.Touched:connect(touched)
