Part disappearing when "WaitForChild()"

Why Part disappearing when i “WaitForChild()”
Here is my Script

local top = game.ServerStorage.Objects.Tree:Clone()
top:SetPrimaryPartCFrame(CFrame.new(xtree,ytree+height,ztree))
top.Parent = workspace
for part=1,54 do
	top:WaitForChild(part).Parent = zchunkmodel:WaitForChild(xtree):WaitForChild(ztree)
	top:WaitForChild(part).Name = top:WaitForChild(part).Position.Y
end

at WaitForChild(part) the part i am “WaitForChild()” for, Always disappearing
i already changed it to “for part=2,54 do” but now the part named “2” disappear

is there anyway i can fix this?

Does the part you are referencing just change the name or does it literally just disappear?

Also

	top:WaitForChild(part).Parent = zchunkmodel:WaitForChild(xtree):WaitForChild(ztree)
	top:WaitForChild(part).Name = top:WaitForChild(part).Position.Y

–the second line won’t work because you already changed the parent of the part

4 Likes

Thank you, i forgot its changing parent. because its only warning in output without showing line