I scripted these doors on my train to move apart using cframe and vector3 when a button is pressed. But when the button is pressed, the trains spazzes out a flies off the map. The script for the moving door is below
function MovePart()
for i = 1,10 do
script.Parent.CFrame = script.Parent.CFrame + Vector3.new(-.5,0,0)
script.Parent.Parent.RightSide.CFrame = script.Parent.Parent.RightSide.CFrame + Vector3.new(.5,0,0)
wait()
end
end
script.Parent.Parent.open.ClickDetector.MouseClick:connect(MovePart)
How can I allow the doors to open (move apart) without having the train spazz out?
(Please note that the train is not anchored and has a weld script that automatically unanchors it as well)
