for _, model in pairs(workspace:GetChildren()) do if model:IsA("Model") then for _, part in pairs(model:GetChildren()) do if part:IsA("Humanoid") and not plr.Character.Humanoid then local copy = part.Parent:Clone() copy.Parent = workspace copy.HumanoidRootPart.CFrame = part.Parent.HumanoidRootPart.CFrame game.Debris:AddItem(copy, 10) end end end end
so here i tried to copy everything that had a humanoid in it and it doesnt work so idk what to do
What Dev answered is almost correct, however it won't work since the character itself isn't archivable. Theres also a lot of unneccesary code, and ideally it can look as short as this:
for _, chars in pairs(workspace:GetChildren()) do if chars:FindFirstChild("Humanoid") and chars ~= plr.Character then chars.Archivable = true local copy = chars:Clone() copy.Parent = workspace game.Debris:AddItem(copy, 10) end end
for _, model in pairs(workspace:GetChildren()) do if model:IsA("Model") then for _, part in pairs(model:GetChildren()) do if part:IsA("Humanoid") and not plr.Character.Humanoid then local copy = part.Parent:Clone() copy.Archivable = true -- Archivable is turned off for all Player's Characters, you have to Enable it if you want to make a copy of a Character copy.Parent = workspace copy.HumanoidRootPart.CFrame = part.Parent.HumanoidRootPart.CFrame game.Debris:AddItem(copy, 10) end end end end
hope this helps