I have this door that I scripted to open when you click the handle, but for some reason instead of "opening" all the parts at once, it opens them one at a time. Here is my script:
local handle1 = script.Parent.Open.Part1
handle1.ClickDetector.MouseClick:Connect(function()
local function Open(part)
part.Transparency = 1
part.CanCollide = false
wait(1)
part.Transparency = 0
part.CanCollide = true
end
for i, v in pairs(script.Parent.Open:GetChildren()) do
Open(v)
end
end)
I used a for i, v in pairs thing to get the children of the door's parent. It opens like this: the board opens, a second later part of the handle opens, then another part of the handle, etc. I'm wondering why it doesn't just open them all at the same time? I also noticed that when there is no wait function it does what its told. Help is appreciated. Thanks.
