Example : https://www.roblox.com/games/4617888640/Vibe-Train https://www.roblox.com/games/2091563160/Bus-Simulator
Basically the script goes
The scenery moves forward then gets teleported back rather seamlessly, either the scenery is incredibly long or the scenery gets teleported backward each time it hits a certain part.
What your looking to use is the :MoveTo() function for models. you can find documentation on it here.
The moveto() function also moves it out of the way of anything, it won't clip with anything. If you want to move it without it moving out of the way, for example, a door moving into a part, you can find documentation on :SetPrimaryPartCFrame() here.
Now since your really vague with your question and not providing sample code of what you have tried, I can't really give you any code examples. Everything you need is on the wiki pages.
Edit:
I understand what you want now.
local originallocation = model.PrimaryPart.CFrame for i = 1,100 do model:SetPrimaryPartCFrame(model.PrimaryPart.Position + Vector3.new(1,0,0)) -- Reduce the 1 for smoother movement. Increase the 100 for it to go longer. wait() end model:SetPrimaryPartCFrame(originallocation)
This code example below repeats it forever.
local originallocation = model.PrimaryPart.CFrame while true do for i = 1,100 do model:SetPrimaryPartCFrame(model.PrimaryPart.Position + Vector3.new(1,0,0)) -- Reduce the 1 for smoother movement. Increase the 100 for it to go longer. wait() end model:SetPrimaryPartCFrame(originallocation) end