So I want this train to despawn when it's out of sight then, respawn and go again, but I don't know where to start with that.

Any help would be nice :)

local Train = script.Parent

--for i = 0,1,.01 do
--	Train:SetPrimaryPartCFrame(Train:GerPrimaryPartCFrame() * CFrame.new(0,0,-i))
--	wait()
--end

while wait() do
	Train:SetPrimaryPartCFrame(Train:GetPrimaryPartCFrame() * CFrame.new(0,0,0 + -.1))
	
end