local a = script.Parent.Door:GetChildren()
for i=1,#a do
wait()
if a[i].ClassName == 'Part' or a[i].ClassName == "UnionOperation" then
local b = Instance.new("NumberValue")
b.Parent = a[i]
b.Name = "Transp"
b.Value = a[i].Transparency
end
end
function open()
for i=1,#a do
a[i].Transparency = 1
a[i].CanCollide = false
end
end
function close()
for i=1,#a do
a[i].Transparency = a[i].Transp.Value
a[i].CanCollide = true
end
end
script.Parent.allowed.Changed:connect(function()
if script.Parent.allowed.Value == true then
open()
else
close()
end
end)
script.Parent.Door.ExitHandle.ClickDetector.MouseClick:connect(function()
script.Parent.allowed.Value = true
wait(3)
script.Parent.allowed.Value = false
end)
Comments