My ragdoll script is kinda weird, and I want to know how can I fix it, or it’s fine? Also, sometimes the player stands and they are still ragdolled.
Ragdolls.Ragdoll = function(char, player)
if player ~= nil then
char.Humanoid.JumpPower = 0
char.Humanoid.WalkSpeed = 0
char.Humanoid.BreakJointsOnDeath = false
for _, v in pairs(char:GetDescendants()) do
if v:IsA("Motor6D") then
local a0, a1 = Instance.new("Attachment"), Instance.new("Attachment")
a0.Name = "SAttachment0"
a1.Name = "SAttachment1"
a0.CFrame = v.C0
a1.CFrame = v.C1
a0.Parent = v.Part0
a1.Parent = v.Part1
v.Part0.CanCollide = true
v.Part1.CanCollide = true
local b = Instance.new("BallSocketConstraint")
b.Attachment0 = a0
b.Attachment1 = a1
b.Parent = v.Part0
v.Enabled = false
The ragdoll script does not seem to have an option for disabling. You might want this to be a feature. For example, if a player falls down but doesn’t die, you can make the player ragdoll for 5 seconds before getting up again.
In that case, with fighting games you should make the player always get up properly (if they get up) after being ragdolled. Sometimes, if mouselock is enabled, the player would spin out of existence and into the void if they don’t get up properly.