I’m currently making a Ragdoll System…
What I’m doing is checking if a troop/boss will be deleted using ChildRemoved
CurrentBoss.ChildRemoved:Connect(function(child: Instance)
RagdollManager.SetRagdoll(child)
end)
Troops.ChildRemoved:Connect(function(child: Instance)
RagdollManager.SetRagdoll(child)
end)
When ChildRemoved gets fired, the ragdoll manager puts the child inside a folder called RagdollContainer. But when checking the container, the models are all empty and due to that, the ragdolls does not work.
This is just the cloning process for the model/entity.
function Ragdoll.SetRagdoll(entity: Model)
-- Make sure the entity hasn't been deleted/destroyed yet.
if entity == nil then return end
local newEntity = entity:Clone()
newEntity.Parent = Ragdoll.Container or workspace
local parts = newEntity:GetDescendants()