lazer = script.Parent
lazerp = script.Parent.Position
lazerx = script.Parent.Position.X
lazery = script.Parent.Position.Y
lazerz = script.Parent.Position.Z
round = true
function forward()
lazerp = Vector3.new(lazerx,lazery,lazerz+1)
end
function backward()
lazerp = Vector3.new(lazerx,lazery,lazerz-1)
end
while true do wait()
if lazerz >= -23 then backward() -- -23 is where the part's Z axis is supposed to stop at before heading back to -46--
elseif lazerz <= -46 then forward() -- -46 is where the part's Z axis begins at--
end
end
Attempting to move a part from point A to Point B No errors in output. Nothing happens in the game. Any help would be appreciated thanks.

2 comments
just use tweenservice instead
TweenService would make it much more easier, since it loops and reverses. Not only that, it also looks less jittery.