Okay so is this at a certain time it activates. Works great, don't mess with it,

-However what I am trying to do is move the spawns at a certain time. Without all the mumble jumble of changing each individual's CFrame and Rotation separately.

I am wanting to use In Pairs loop to find all the parts in the spawn model, then go to a different model and find the name of that single part and change its CFrame to that part's CFrame.

So basically, I have a model with different area spawns in it. I have another model with just a bunch of parts. with the exact same names at the spawn locations. It is suppose to and get lets say 'ZTele1' (which is a spawn), and go into the parts model and find ZTele1 (as a part) and get that location and change the original spawn location to that specific part's location.

Here is the script:

port = script.Parent.Parent.ZombiesTele
fix = script.Parent.Parent.ZombieSpawnFixer
local Count = script.Counter
local area3 = port.Area3
local level2 = fix.LevelTwoFix
local change3 = level2.Area3

game.Workspace.TimerCounter.Changed:connect(function(val) 
	if val == 390 then
		for Distance=1,0, -1 do
			wait()
			Count.Value = Distance
			for i, v in pairs (area3:GetChildren()) do
				v.CFrame = CFrame.new(change3.v.Cframe)
			end	
		end
	end
end)

However everytime I run this it says the "v" is a nil value. at "(change3.v.CFrame)" aka: v is not a valid member of model (The parts model)

3 comments

0

It should be change3[v.Name].CFrame because this script is looking for the exact 'v' part, not it's name.

0

thank you it worked :D

0

Please mark your question as solved.