Hello,
I am making a prison game. Certain teams need to be able to access the door, and when they click on the door, it should open. However, only the first team (Bright blue) is allowed to open the door, and not the rest in local teams. Please help! This script is inside of a click detector.
local teams = BrickColor.new("Bright blue") or BrickColor.new("Bright red")
local open = false
script.Parent.MouseClick:Connect(function(Plr)
print("Started")
if Plr.TeamColor == teams then
if open == false then
print("Checked the team Colored")
for i,v in pairs(script.Parent.Parent.Parent.Door:GetChildren()) do
v.Transparency = 1
v.CanCollide = false
open = true
end
elseif open == true then
for i,v in pairs(script.Parent.Parent.Parent.Door:GetChildren()) do
v.Transparency = v.Transp.Value
v.CanCollide = true
open = false
end
else
wait(30)
for i, v in pairs(script.Parent.Parent.Parent.Door:GetChildren()) do
v.Transparency = v.Transp.Value
v.CanCollide = true
open = false
end
end
else
print("Don't have passed!")
end
end)

1 comment
These doors should also close after 30 seconds, but they do not.