I have a problem. The NPCs seem to have a hard time getting up after ragdolling.
This is the code which I use to handle ragdolls:
function module:Ragdoll(target, knockTime)
if not target:FindFirstChild("RagdollConstraints") then
ragdoll:Setup(target)
end
ragdoll:Ragdoll(target)
task.delay(knockTime, function()
ragdoll:Unragdoll(target)
end)
end
I also apply a force when the target is ragdolled, for extra impact, but I don’t know if that’s what’s causing it (in this case physical
is true)
function module:Knockback(sender, reciever, power, physical)
local vec = sender.PrimaryPart.CFrame.LookVector * power
local prim = reciever.PrimaryPart
if physical then
prim:ApplyImpulse(vec)
else
ts:Create(prim, TweenInfo.new(0.5, Enum.EasingStyle.Linear), {Position = prim.CFrame * vec}):Play()
end
end