Second model overlapping the first model

Hello,

So, the thing is that when the first model claimes a random parent the second model SHOULD NOT has the same parent as the first model. Which is in my case and I don’t want that ofcourse cause then I have 2 models overlapping each other.

Here’s the script;


local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ReplicatedStorage2 = game.ReplicatedStorage.Folder1

local Order = ReplicatedStorage:WaitForChild("CreateOrderRequest")


local bf = game.Workspace:WaitForChild("AcceptOrder")

local PassAcceptedOrderData = game.Workspace:WaitForChild("PassAcceptedOrderData")

local char = {
	"OldTv";
	"Salora58UA330";
}
local Value1 = 15
local Value2 = 120

local function orderRequest(player)
	print("ok")
	for i, v in pairs(ReplicatedStorage2:GetChildren()) do
		if v.Name == "OldTv" then
			local Order1 = player.PlayerGui.ComputerMenu.Orders.Background1.Order1
			Order1.Visible = false
			Order1.Text = ""
			Order1.TVSelecter.Text = ""
			local CompleteOrder = Instance.new("BoolValue")
			CompleteOrder.Parent = ReplicatedStorage2
			CompleteOrder.Value = true
			
			local OnlyZone = game.Workspace.StandardBuilding.Storage.Places.OrderValue
			
			local zone = game.Workspace.StandardBuilding.Storage.Places
			
			if CompleteOrder.Value == true and OnlyZone.Value <= 4 then
				for i = 1, 4 do
					local OrderPlacer = game.Workspace.StandardBuilding.Storage.TruckDoorParts.OrderPlacer
					local WhiteBox = OrderPlacer["Place"..i].PackagePlace.SelectionBox
					WhiteBox.Visible = true
					
					wait(0.5)
					if WhiteBox.Visible == true and OnlyZone.Value <= 4 then
						
						print(OnlyZone.Value)
						for spot = 1, 6 do
							local Places = game.Workspace.StandardBuilding.Storage.Places
							local Spots = Places["Spot"..spot].Part
							if Spots then
								for i, v in pairs(Spots:GetChildren()) do
									if v.Name == "tvBox" then
									
											
										local BoxToStorage = Spots:FindFirstChild("tvBox")
										BoxToStorage:SetPrimaryPartCFrame(OrderPlacer["Place"..i].PackagePlace.CFrame)
										BoxToStorage.Parent = OrderPlacer["Place"..i].PackagePlace
										print(spot)
											
										
								
										OnlyZone.Value = OnlyZone.Value - spot
										
									end
								end
							end
						end					
					end
				end
				
				game.Workspace.StandardBuilding.Storage.TruckDoorParts.OrderPlacer.Place1.PackagePlace.SelectionBox.Visible = true
				
				wait(5)
				
			else
				local StorageTutorialgiver = ReplicatedStorage:WaitForChild("StorageTutorialgiver")
				
				StorageTutorialgiver:FireClient(player)
				
			end
		end
	end
	
end

Order.OnServerInvoke = orderRequest





I hope you guys can help me with this!


local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ReplicatedStorage2 = game.ReplicatedStorage.Folder1

local Order = ReplicatedStorage:WaitForChild("CreateOrderRequest")


local bf = game.Workspace:WaitForChild("AcceptOrder")

local PassAcceptedOrderData = game.Workspace:WaitForChild("PassAcceptedOrderData")

local char = {
	"OldTv";
	"Salora58UA330";
}
local Value1 = 15
local Value2 = 120

local function orderRequest(player)
	print("ok")
	for i, v in pairs(ReplicatedStorage2:GetChildren()) do
		if v.Name == "OldTv" then
			local Order1 = player.PlayerGui.ComputerMenu.Orders.Background1.Order1
			Order1.Visible = false
			Order1.Text = ""
			Order1.TVSelecter.Text = ""
			local CompleteOrder = Instance.new("BoolValue")
			CompleteOrder.Parent = ReplicatedStorage2
			CompleteOrder.Value = true
			
			local OnlyZone = game.Workspace.StandardBuilding.Storage.Places.OrderValue
			
			local zone = game.Workspace.StandardBuilding.Storage.Places
			
			if CompleteOrder.Value == true and OnlyZone.Value <= 4 then
				for i = 1, 4 do
					local OrderPlacer = game.Workspace.StandardBuilding.Storage.TruckDoorParts.OrderPlacer
					local WhiteBox = OrderPlacer["Place"..i].PackagePlace.SelectionBox
					WhiteBox.Visible = true
					
					wait(0.5)
					if WhiteBox.Visible == true and OnlyZone.Value <= 6 then
						
						print(OnlyZone.Value)
						for spot = 1, 4 do
							print(spot)
							local Places = game.Workspace.StandardBuilding.Storage.Places
							local Spots = Places["Spot"..spot].Part
							if Spots then
								for z = 1, 4 do
									if Places["Spot"..z].Part:FindFirstChild("tvBox") then
										
									
											
										local BoxToStorage = Spots:FindFirstChild("tvBox")
										BoxToStorage:SetPrimaryPartCFrame(OrderPlacer["Place"..i].PackagePlace.CFrame)
										BoxToStorage.Parent = OrderPlacer["Place"..i].PackagePlace
										print(spot)
											
										
								
										OnlyZone.Value = OnlyZone.Value - 1
										
									end
								end
							end
						end					
					end
				end
				
				game.Workspace.StandardBuilding.Storage.TruckDoorParts.OrderPlacer.Place1.PackagePlace.SelectionBox.Visible = true
				
				wait(5)
				
			else
				local StorageTutorialgiver = ReplicatedStorage:WaitForChild("StorageTutorialgiver")
				
				StorageTutorialgiver:FireClient(player)
				
			end
		end
	end
	
end

Order.OnServerInvoke = orderRequest




Now I tried this but its giving this error anyway to solve that cause I have no clue;