✓ Accepted answer
your script looks for a specific player and doesn't generalize to accommodate other players
you could simply just do this:
local team_changer = workspace.etc
team_changer.Touched:Connect(function(part)
local parent = part.Parent
local player;
if parent then
player = game.Players:GetPlayerFromCharacter(parent)
if player then
player.TeamColor = Brickcolor.new("Really red")
end
end
end)
so the above code listens to when the the part stored in team_changer is touched;
then declares a variable parent to get the parent of the part that touched the team changer, then declares player and sets it to nil, next: it checks if the parent is there then assigns player to the corresponding Player object in Players Service from the character model stored in player
2 comments
(On touch)
Your script is looking for "Level2" in game.Players. That is probably your mistake. WIth this script you would want to make it like game.Players:FindFirstChild(hit.Parent.Name). Try GetPlayerFromCharacter