This is probably simple, but I just learned about CFrame. I'm trying to make the part this script is in, Move up and down over and over in the current position it is already in. This does not seem to loop.
function movement()
while true do
wait()
for y = -5,5, 0.1 do
script.Parent.CFrame = CFrame.new(-98, 1.7, -15) * CFrame.new(0, y, 0)
end
end
end
movement()
Is there another way to move my part from a position instead of assigning it to stay in the X axis and Y axis above? i.e. if I dragged this part somewhere else, It stays there not moves(Minus Up and Down)

2 comments
What do you mean "this doesn't seem to loop"? What does it do instead?
Currently it freezes at position (-98, 6.7, -15)