I want a player to be teleported away from a part if their team color doesn't match the part's color. Output says there is a problem with line 4, can anyone help me?
script.Parent.Touched:connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
wait()
if player.TeamColor == BrickColor.new("Bright blue") or player.TeamColor == BrickColor.new("Really blue") and script.Parent.BrickColor == BrickColor.new("Bright green") then
hit.Parent.Torso.CFrame = CFrame.new(Vector3.new(-49,4,109))
elseif player.TeamColor == BrickColor.new("Bright green") or player.TeamColor == BrickColor.new("Camo") and script.Parent.BrickColor == BrickColor.new("Bright blue") then
hit.Parent.Torso.CFrame = CFrame.new(Vector3.new(-49,4,-79))
end
end)

1 comment
The block is teleporting me no matter what team color I possess, which is the problem.