Even though it’s slow, the opening looks stable (roughly same amount of time between each iteration), so I doubt it’s related to replication. In all likeliness it’s that wait() is not playing nicely. wait() will try to wait for 1/30th of a second, but if the server has a heavy load, it will throttle waits. If the scripts in your server are slowing down as the game goes on longer, this would cause waits to throttle. In general, you should avoid using wait() whenever possible – use events like Heartbeat/Stepped/RenderStepped and their dt parameter.
Unrelated to issue, but:
- I would not recommend using SetPrimaryPartCFrame as it offsets parts over time
- I would recommend opening the gates on the client anyway – even without this issue, there will always be latency present when animating the doors. Animating them on the client will allow you to make animations that are as smooth as the player’s framerate