Need help with pairs

So the problem is that it only teleports one of the Slashes and not all of them. Please help!

for i,v in pairs(plr.Character.MistSlash:GetChildren()) do
	if v:IsA("MeshPart") then
		v.CFrame = plr.Character.HumanoidRootPart.CFrame + Vector3.new(0,0,-0.5)
	end
end

There isn’t anything wrong with the code, try printing out how many MeshParts are available inside the MistSlashes by adding a print statement right after the if statement.

Alright, that works and it prints 5 times. So I don’t get why only only one part comes?

Oh, I see the problem now.

You’re making them all teleported into that one EXACT location, which results them in the same position and makes you think “oh it’s only one”.

You could add like an offset whenever a part gets tped to visualize it better.

Add Some type of wait like task.wait(0.1)

You’re right! I thought that was not it because I had custom orientation for each one of them but the orientation resets when they get teleported for some reason. Anyway thank you!

That’s because a CFrame value contains both positional & orientational data. If you want to retain the rotations of the teleported BasePart instances then change their “Position” properties only.

for i,v in pairs(plr.Character.MistSlash:GetChildren()) do
	if v:IsA("MeshPart") then
		v.Position = plr.Character.HumanoidRootPart.Position + Vector3.new(0, 0, -0.5)
	end
end