function onC()
for i,k in pairs(script.Parent.Parent:GetChildren()) do
if string.find(k.Name,"Window") then
if k.Transparency == 1 then
k.Transparency = 0
end
end
if string.find(k.Name,"Door") then
if k.Transparency == 1 then
k.Transparency = 0
end
if k.CanCollide == false then
k.CanCollide = true
end
end
end
wait(1)
for i,k in pairs(script.Parent.Parent:GetChildren()) do
if string.find(k.Name,"Window") then
if k.Transparency == 0 then
k.Transparency = 1
end
end
if string.find(k.Name,"Door") then
if k.Transparency == 0 then
k.Transparency = 1
end
if k.CanCollide == true then
k.CanCollide = false
end
end
end
end
script.Parent.Parent.ClickDetector.MouseClick:connect(onC) |