How to make timed doors?

I’m making an elevator game, and I can’t make an elevator door that works on time (for example, 25 seconds pass - the doors open, after that 50 seconds pass and the doors close). I have a problem with this, for some reason the doors open and close out of time (for example, the doors should open in 25 seconds, and open a few seconds later, the same with closing the door, and each time they start not to fall into time because of this). I think this is because: 25 seconds go by, the doors open, the countdown of 50 seconds does not start until the doors finish opening. I dont know how to explain it,
maybe it can help to understand
doors.rbxl (36.6 KB)

So why not just wait 25 seconds for door to close (50-25=25)

How are you moving the doors? Lag may cause the issue.
You should check to see if the door is at the Position it’s supposed to be at before starting the next movement.
Also you said: (for example, the doors should open in 25 seconds, and open a few seconds later, the same with closing the door, and each time they start not to fall into time because of this)
I don’t get what you mean by the highlighted section of your comment. It sounds like it opens, then opens again?