I’m trying to make my combat system have a ragdoll function on the last hit, though I am having trouble with the ragdoll.
It basically works its just that the arms don’t move when they’re meant to fling, which is visually really bad, I just need some help on how to get them working. I’ve been stuck on this for a few weeks and want to get it sorted.
I have tried a lot of things so far like using HingeConstraints instead but nothing just seems to work for me.
Here is what I have so far: (After the wait is just the joints getting destroyed so you can just ignore them)
- Note that this is a server sided version for NPCs (im having the same problem with players though)
Humanoid.AutoRotate = false
Humanoid.BreakJointsOnDeath = false
Humanoid.RequiresNeck = false
Humanoid:ChangeState(Enum.HumanoidStateType.Physics)
for _, v in pairs(VictimChar:GetDescendants()) do --ragdoll
if v:IsA("Motor6D") then
v.Enabled = false
local a0, a1 = Instance.new("Attachment"), Instance.new("Attachment")
a0.CFrame = v.C0
a1.CFrame = v.C1
a0.Parent = v.Part0
a1.Parent = v.Part1
a0.Name = "A0 - "..v.Name
a1.Name = "A1 - "..v.Name
local b = Instance.new("BallSocketConstraint")
b.Attachment0 = a0
b.Attachment1 = a1
b.Parent = v.Part0
b.Name = "BallSocket - "..v.Name
end
end
wait(Time)
Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
Humanoid.BreakJointsOnDeath = true
Humanoid.RequiresNeck = true
Humanoid.AutoRotate = true
for _,v in pairs(VictimChar:GetDescendants()) do --unragdoll
if v:IsA('Motor6D') then
v.Enabled = true
end
if v.Name == 'BallSocketConstraint' then
v:Destroy()
end
if v.Name == 'Attachment' then
v:Destroy()
end
end