I have an object that I want to move back and forth along a straight line. Here is the script:

local PrimaryPartCFrame = script.parent:GetPrimaryPartCFrame()


while wait() do
	for i = 0,-10,-.05 do
	script.Parent:TranslateBy(Vector3.new(0,0,i))
	wait()
	if PrimaryPartCFrame = 42.507, 10.469, -710.04 then
	script.Parent:TranslateBy(Vector3.new(0,0,-i))	
	wait()
	end
end	
end

It doesn't move. How do I fix this?

EDIT: I probably should have mentioned this is a model.

1 comment

1

use tweenservice