So after a recent roblox update between the last 2 months or so, it seems that alongside a bunch of other roblox games, my ragdoll engine has also broken for some odd reason. The characters just get stiff and do not ragdoll. Can someone please explain how or why this has occured? I can post the original script below.
Thanks
function Glue(Part, C0, C1, Part0, Part1, Name)
local Glue = Instance.new("Glue") do
Glue.Name = Name
Glue.C0 = C0
Glue.C1 = C1
Glue.Part0 = Part0
Glue.Part1 = Part1
Glue.Parent = Part
end
end
function Joint(Part, C0, C1, Part0, Part1, Name)
local Motor6D = Instance.new("Motor6D") do
Motor6D.Name = Name
Motor6D.C0 = C0
Motor6D.C1 = C1
Motor6D.Part0 = Part0
Motor6D.Part1 = Part1
Motor6D.Parent = Part
end
end
function Touch(Part, Limb, WeldCFrame)
local TouchPart = Instance.new("Part") do
TouchPart.Name = "TouchPart"
TouchPart.Size = Vector3.new(1, 1, 1)
TouchPart.Transparency = 1
TouchPart.CustomPhysicalProperties = PhysicalProperties.new(.55, .3, .5)
TouchPart.CanCollide = true
TouchPart.Anchored = false
TouchPart.Parent = Part
end
local Weld = Instance.new("Weld") do
Weld.Part0 = TouchPart
Weld.Part1 = Limb
Weld.C0 = WeldCFrame
Weld.Parent = TouchPart
end
end
Character = script.Parent
Humanoid = Character:WaitForChild("Humanoid")
HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
Torso = Character:WaitForChild("Torso")
LeftArm = Character:WaitForChild("Left Arm")
RightArm = Character:WaitForChild("Right Arm")
LeftLeg = Character:WaitForChild("Left Leg")
RightLeg = Character:WaitForChild("Right Leg")
Ragdolled = Instance.new("BoolValue") do
Ragdolled.Name = "Ragdolled"
Ragdolled.Parent = Character
end
Blocking = Instance.new("BoolValue") do
Blocking.Name = "Blocking"
Blocking.Parent = Character
end
LeftArmC0 = CFrame.new(-1.5 * 1, 0.5 * 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
LeftArmC1 = CFrame.new(0, 0.5 * 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
RightArmC0 = CFrame.new(1.5 * 1, 0.5 * 1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
RightArmC1 = CFrame.new(0, 0.5 * 1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
LeftLegC0 = CFrame.new(-0.5 * 1, -1 * 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
LeftLegC1 = CFrame.new(0 * 1, 1 * 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
RightLegC0 = CFrame.new(0.5 * 1, -1 * 1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
RightLegC1 = CFrame.new(0, 1 * 1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
function Ragdollify()
if Ragdolled.Value then return end
Ragdolled.Value = true
Blocking.Value = false
Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, true)
HumanoidRootPart.CanCollide = false
HumanoidRootPart.Massless = true
Humanoid.PlatformStand = true
if (HumanoidRootPart:FindFirstChild("OOF") and not HumanoidRootPart:FindFirstChild("OOF").IsPlaying) and HumanoidRootPart.Health <= 1 then
HumanoidRootPart.OOF:Play()
HumanoidRootPart.OOF.TimePosition = .5
end
Humanoid.AutoRotate = false
if LeftArm and Torso:FindFirstChild("Left Shoulder") then
Torso:FindFirstChild("Left Shoulder"):Destroy()
Glue(Torso, LeftArmC0, LeftArmC1, Torso, LeftArm, "Left Shoulder")
Touch(LeftArm, LeftArm, CFrame.new(0, .5, 0))
end
if RightArm and Torso:FindFirstChild("Right Shoulder") then
Torso:FindFirstChild("Right Shoulder"):Destroy()
Glue(Torso, RightArmC0, RightArmC1, Torso, RightArm, "Right Shoulder")
Touch(RightArm, RightArm, CFrame.new(0, .5, 0))
end
if LeftLeg and Torso:FindFirstChild("Left Hip") then
Torso:FindFirstChild("Left Hip"):Destroy()
Glue(Torso, LeftLegC0, LeftLegC1, Torso, LeftLeg, "Left Hip")
Touch(LeftLeg, LeftLeg, CFrame.new(0, .5, 0))
end
if RightLeg and Torso:FindFirstChild("Right Hip") then
Torso:FindFirstChild("Right Hip"):Destroy()
Glue(Torso, RightLegC0, RightLegC1, Torso, RightLeg, "Right Hip")
Touch(RightLeg, RightLeg, CFrame.new(0, .5, 0))
end
end
function Unragdollify()
for i, v in ipairs(Character:GetDescendants()) do
if v.Name == "TouchPart" then
v:Destroy()
end
end
if LeftArm and Torso:FindFirstChild("Left Shoulder") then
Torso:FindFirstChild("Left Shoulder"):Destroy()
Joint(Torso, LeftArmC0, LeftArmC1, Torso, LeftArm, "Left Shoulder")
end
if RightArm and Torso:FindFirstChild("Right Shoulder") then
Torso:FindFirstChild("Right Shoulder"):Destroy()
Joint(Torso, RightArmC0, RightArmC1, Torso, RightArm, "Right Shoulder")
end
if LeftLeg and Torso:FindFirstChild("Left Hip") then
Torso:FindFirstChild("Left Hip"):Destroy()
Joint(Torso, LeftLegC0, LeftLegC1, Torso, LeftLeg, "Left Hip")
end
if RightLeg and Torso:FindFirstChild("Right Hip") then
Torso:FindFirstChild("Right Hip"):Destroy()
Joint(Torso, RightLegC0, RightLegC1, Torso, RightLeg, "Right Hip")
end
Humanoid.PlatformStand = false
Humanoid.AutoRotate = true
HumanoidRootPart.Massless = false
HumanoidRootPart.CanCollide = true
Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
Humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, true)
local FloatThing = Instance.new("BodyPosition") do
FloatThing.Position = HumanoidRootPart.Position + Vector3.new(0, 2, 0)
FloatThing.Parent = HumanoidRootPart
game.Debris:AddItem(FloatThing, 0.25)
end
local Stabilizer = Instance.new("BodyGyro") do
Stabilizer.P = 1000000
Stabilizer.D = 500
Stabilizer.MaxTorque = Vector3.new(10000, 0, 10000)
Stabilizer.Parent = HumanoidRootPart
game.Debris:AddItem(Stabilizer, .25)
end
Ragdolled.Value = false
end
-- Ragdoll events here:
ReplicatedStorage = game:GetService("ReplicatedStorage")
RagdollifyEvent = ReplicatedStorage:WaitForChild("Ragdollify", 5)
if not RagdollifyEvent then
RagdollifyEvent = Instance.new("BindableEvent") do
RagdollifyEvent.Name = "Ragdollify"
RagdollifyEvent.Parent = ReplicatedStorage
end
end
UnragdollifyEvent = ReplicatedStorage:WaitForChild("Unragdollify", 5)
if not UnragdollifyEvent then
UnragdollifyEvent = Instance.new("BindableEvent") do
UnragdollifyEvent.Name = "Unragdollify"
UnragdollifyEvent.Parent = ReplicatedStorage
end
end
RagdollifyEvent.Event:Connect(function(PlayerToAffect)
if PlayerToAffect ~= Character then return end
Ragdollify()
end)
UnragdollifyEvent.Event:Connect(function(PlayerToAffect)
if PlayerToAffect ~= Character then return end
Unragdollify()
end)