Hello everybody! I’m having a problem when trying to clone a model and place it inside a specific folder, as the model is being cloned with nothing inside. This is the part of the code responsible for cloning:
local mobExists = ServerStorage.Mobs:FindFirstChild(name)
local Luther = game.ReplicatedStorage.Troops:WaitForChild("Luter gigante")
...
elseif isTroop == true then
local newMob = Luther:Clone()
newMob:WaitForChild("HumanoidRootPart").CFrame = map.Waypoints:FindFirstChild("15").CFrame
newMob.Parent = workspace.Mobs
newMob.HumanoidRootPart:SetNetworkOwner(nil)
local movingTo = Instance.new("NumberValue", newMob)
movingTo.Name = "MovingTo"
movingTo.Value = -1
for i, obj in ipairs(newMob:GetDescendants()) do
if obj:IsA("BasePart") or obj:IsA("MeshPart") then
obj.CollisionGroup = "Mob"
end
end
movingTo.Value = 15
print(newMob.Parent)
newMob:WaitForChild("Humanoid").Died:Connect(function()
task.wait(0.5)
newMob:Destroy()
end)
coroutine.wrap(mob.Move)(newMob, map)
end
This part of the code is responsible for cloning an existing model and placing it in the game, then calling another function responsible for moving it, however, when cloning the model, it is cloned completely empty, with no part inside it that original model had. But this seems to happen specifically with a folder called “Troops”, if I clone the model and place it inside another folder called “Mobs” it is cloned correctly.
the model being cloned in the Mobs folder:
the model being cloned in the Troops folder:
If anyone knows why the model is being cloned incorrectly and can help with how to prevent it, I would be grateful. (Sorry for the bad English)