After searching up solutions I ended up with a result like this
It looks like its trying to stand up and it wont flop over like a normal ragdoll
I’m trying to replicate a model I found that I cant find anymore that works by turning on and off a bool value and it switches the ragdoll on and off
Script (StarterCharacterScripts)
local character = script.Parent
local humanoid : Humanoid = character:WaitForChild("Humanoid")
local ragdoll = script.Parent:WaitForChild("Ragdoll")
ragdoll.Changed:Connect(function(bool)
if bool then
humanoid:ChangeState(Enum.HumanoidStateType.Physics)
humanoid.WalkSpeed = 0
humanoid.JumpHeight = 0
humanoid.RequiresNeck = false
for _,instance in pairs(script.Parent:GetDescendants()) do
if instance:IsA("Motor6D") then
local socket = Instance.new("BallSocketConstraint")
local a1 = Instance.new("Attachment")
local a2 = Instance.new("Attachment")
a1.Parent = instance.Part0
a2.Parent = instance.Part1
a1.Name = "a1"
a2.Name = "a2"
socket.Parent = instance.Parent
socket.Attachment0 = a1
socket.Attachment1 = a2
a1.CFrame = instance.C0
a2.CFrame = instance.C1
socket.LimitsEnabled = true
socket.TwistLimitsEnabled = true
instance.Enabled = false
elseif instance:IsA("MeshPart") then
if instance.Name == ("LeftLowerArm" or "LeftLowerLeg" or "RightLowerArm" or "RightLowerLeg" or "Head") then
instance.CanCollide = true
instance.CollisionGroup = "Ragdoll"
end
end
end
elseif not bool then
for _,instance in pairs(script.Parent:GetDescendants()) do
if instance:IsA("BallSocketConstraint") then
instance:Destroy()
elseif instance:IsA("Motor6D") then
instance.Enabled = true
elseif instance:IsA("MeshPart") then
if instance.Name == ("LeftLowerArm" or "LeftLowerLeg" or "RightLowerArm" or "RightLowerLeg" or "Head") then
instance.CanCollide = false
instance.CollisionGroup = "Default"
end
elseif instance.Name == ("a1" or "a2") then
instance:Destroy()
end
end
humanoid:ChangeState(Enum.HumanoidStateType.Running)
humanoid.WalkSpeed = 16
humanoid.JumpHeight = 7.2
humanoid.RequiresNeck = true
end
end)