Well, I'm trying to make a team door but this script doesn't seem to work...
script.Parent.Touched:connect(function(part)
print("Wow")
local h = part.Parent:FindFirstChild("Humanoid")
if h == nil then return end
print("1")
local char = part.Parent
local player = game.Players:FindFirstChild(char.Name)
if player == nil then return end
print("2")
if not player.TeamColor == BrickColor.new("Bright red") then
print("Wow!")
h.Health = 0
end
end)
I put in print functions, but Wow, 1 and 2 printed out. The problem is, I was in blue team, and I never got killed. Why?
