To put it simply.
The code you have inputted does the following:
As a counter goes up in the for loop, as does the value “i”, however “i” begins at 1, therefore when
for i=1,3 do
is run, you are saying:
Starting from one, I want you to find Door1 and Cframe it, then I want you to repeat and find Door2, then Door3, then move on to the next part of the code.
From what I see in your code, just remove the …i and you should be good, so in conclusion,
script.Parent.D1.Parts.Door.CFrame = script.Parent.D1.Parts.Door.CFrame*CFrame.fromEulerAnglesXYZ(0,0,inc*dir)
Note: If there is an issue with cframes I did not solve it.