How do I make it so a team can get through not just a player?
door = script.Parent;
locked = true
function setform(v)
locked = v
if v then
door.Transparency = 1
door.Reflectance = 0.4
door.CanCollide = true
else
door.Transparency = 0.7
door.Reflectance = 0
door.CanCollide = false
end
end
function click(player)
if player.Name == "Username" then
if locked then
setform(false)
wait(5)
setform(true)
end
end
end
door.ClickDetector.MouseClick:connect(click)

1 comment
please indent you code, and players have a Team property