func_tracktrain not moving to path.

So I have a camera on the map that goes around pointing at Vector(0,0,0). At it has 10 path_track’s setup and the 10th has its next target set to 11 on the map but the func_tracktrain ends at the 10th for some reason.
After not getting it to work I added a second tracktrain to follow along the new created track but it seems to stay in place.
Do I need to do TrackTester:Fire(‘resume’) to make it move again? Anyway to make the map tracktrain to move onto the newly created paths?

I haven’t done coding in a few years so if this is sloppy I am sorry. D:

[lua]

/*for _,v in pairs( ents.FindByClass( "func_tracktrain" ) ) do
	v:Fire( "teleporttopathtrack" , "30", 0 )
	v:Fire( "resume" )
end*/

local aTracks = 32
local sTracks = 11
for i=1,aTracks do 

	local min,max = -30000, 30000
	local Next = i+1

	if i >=sTracks then
		if Next != aTracks + 1 then
			local TrackPath = ents.Create( "path_track" ) if !IsValid( TrackPath ) then return end
			TrackPath:SetKeyValue( "targetname", i )
			TrackPath:SetKeyValue( "target" , Next )
			TrackPath:SetPos( Vector( math.random(min,max), math.random(min,max), 1000 ) )
			TrackPath:Spawn()
		else
			local TrackPathEnd = ents.Create( "path_track" ) if !IsValid( TrackPathEnd ) then return end
			TrackPathEnd:SetKeyValue( "targetname" , aTracks )
			TrackPathEnd:SetKeyValue( "target", "1" )
			TrackPathEnd:SetPos( Vector( math.random(min,max), math.random(min,max), 1000 ) )
			TrackPathEnd:Spawn()
		end
	end
end

local TrackTester = ents.Create( "func_tracktrain" ) if !IsValid( TrackTester ) then return end
TrackTester:SetKeyValue( "targetname" , "camtrack2" )
TrackTester:SetKeyValue( "target" , "20" )
TrackTester:SetKeyValue( "spawnflags" , "523" )
TrackTester:SetModel( "models/props_c17/FurnitureCouch001a.mdl" )
TrackTester:Spawn()

[/lua]

Seems when the map is compiled if the target does not exist it doesn’t decide to do anything else…