I was following this YouTube tutorial on how to make a ragdoll module and for some reason my module doesn’t ragdoll the person it just makes them platform stand and that’s it
local module = {}
function module.Start(Rig : Model)
local Humanoid = Rig:FindFirstChildWhichIsA("Humanoid")
for _, Motor in pairs(script.Parent:GetDescendants()) do
if Motor:IsA("Motor6D") then
local Socket = Instance.new("BallSocketConstraint")
local Attachment0 = Instance.new("Attachment")
local Attachment1 = Instance.new("Attachment")
Attachment0.CFrame = Motor.C0
Attachment1.CFrame = Motor.C1
Attachment0.Parent = Motor.Part0
Attachment1.Parent = Motor.Part1
Socket.Attachment0 = Attachment0
Socket.Attachment1 = Attachment1
Socket.LimitsEnabled, Socket.TwistLimitsEnabled = true, true
Socket.Parent = Motor.Parent
Motor:Destroy()
end
end
local properties = {
PlatformStand = true,
AutoRotate = false,
WalkSpeed = 0,
JumpPower = 0,
JumpHeight = 0
}
module[Rig] = {} -- create 5
for name, value in properties do
module[Rig][name] = Humanoid[name]
Humanoid[name] = value
end
end
function module.Stop(Rig : Model)
local properties = module[Rig]
if properties then
local Humanoid = Rig:FindFirstChildWhichIsA("Humanoid")
for name, value in properties do
Humanoid[name] = value
end
for _, Descendant in Rig:GetDescendants() do
if Descendant:IsA("BallSocketConstraint") then
Descendant:Destroy()
elseif Descendant:IsA("Motor6D") then
Descendant.Enabled = true
end
end
Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
module[Rig] = nil
end
end
return module