Button = script.Parent.Button.ClickDetector
SecondButton = script.Parent.ButtonTwo.ClickDetector
---Door Parts---
WOne = script.Parent.WedgeOne
WTwo = script.Parent.WedgeTwo
---Positions---
WPOne = script.Parent.PosOne
WPTWo = script.Parent.PosTwo
Button.MouseClick:connect(function()
for i = 0,1,0.01 do
WOne.CFrame = WOne.CFrame:lerp(WPOne.CFrame, i)
WTwo.CFrame = WTwo.CFrame:lerp(WPTWo.CFrame, i)
wait()
end
end)
SecondButton.MouseClick:connect(function()
for i = 0,1,0.01 do
WOne.CFrame = WOne.CFrame:lerp(WPOne.CFrame, i)
WTwo.CFrame = WTwo.CFrame:lerp(WPTWo.CFrame, i)
wait()
end
end)
So I made doors that open with the lerp() method but I cant figure out how to close them automatically after a certain amount of time.
The wait at the end of each for loop is necessary to make the transition smooth, and I am out of ideas any and all help is appreciated.
