Fixed that but then the door doesn't work correctly.
The -572 is there because it is meant to run that function only when the door pos.z is bigger than -572 so it runs until the door pos is equal to 572 and then stops there.
But thanks for helping and i am guessing one of the textures you were talking about was the first room?