This script is supposed to kill people who aren't on a certain team, but it doesn't work
function onTouch(part)
local humanoid = part.Parent:FindFirstChild("Humanoid")
if (humanoid ~= nil) then
if part.Parent.Player.TeamColor ~= script.Parent.Parent.Parent.Parent.Parent.TeamColor.Value then
humanoid.Health = 0 -- damage the humanoid
end
end
end
script.Parent.Touched:connect(onTouch)
errors: TeamColor is not a valid member of Model
