Is this?
Brick = script.Parent Door1 = game.Workspace.Door.Left Door2 = game.Workspace.Door.Right function onTouched(hit) if hit.Parent then Door1.Move = Right 1 Door2.Move = Left 1 wait(3) Door1.Move = Left 1 Door2.Move = Right 1 end end Brick.MouseButton1Click:connect(onTouched)
Try this code instead. Lua doesn't use direction. It uses numbers and Cframe values (at least I know this method.)
function onClicked() for i=1,20 do script.Parent.Parent.Lock3.CFrame = script.Parent.Parent.Lock3.CFrame * CFrame.new(0, 1, 0) script.Parent.Parent.Lock4.CFrame = script.Parent.Parent.Lock4.CFrame * CFrame.new(0, -1, 0) wait(0.01) end for i=1,20 do script.Parent.Parent.Lock3.CFrame = script.Parent.Parent.Lock3.CFrame * CFrame.new(0, -1, 0) script.Parent.Parent.Lock4.CFrame = script.Parent.Parent.Lock4.CFrame * CFrame.new(0, 1, 0) wait(0.01) end end script.Parent.Parent.Open.ClickDetector.MouseClick:connect(onClicked)