Line 6 is where I thought it will work but it's not. If you remove player.TeamColor == BrickColor.new("Institutional white") and then it works, but I am trying to make a team door. It's a multiple part garage door.
Half was solved already (Garage door part) but the team door part wasn't solved.
local MainPart = script.Parent
local Model = MainPart.Parent.Door
player = game.Players
function toggleVisibility(bool)
if player.TeamColor == BrickColor.new("Institutional white") and bool == false then
for i,v in pairs(Model:GetChildren()) do
v.Transparency = 1
v.CanCollide = false
end
wait (2)
for i,v in pairs(Model:GetChildren()) do
v.Transparency = 0
v.CanCollide = true
script.Parent.Parent.Door.Part7.Transparency = 0.4
end
end
end
function onTouched(touched)
toggleVisibility(false)
wait(2)
toggleVisiblilty(true)
end
MainPart.Touched:Connect(onTouched)

2 comments
game.Players is a service. 'player' (game.Players) is not a player, but a service.. so saying 'player.TeamColor' makes no sense because TeamColor is not a valid member of game.Players.
True,