My ragdoll script has been running into a problem. Whenever the ragdoll bool is true, everything else works except the line where it changes the state to Physics. I don’t see how this would not work and I am genuinely confused.
Code:
local RagdolledBool = script.Parent.Ragdolled
RagdolledBool:GetPropertyChangedSignal("Value"):Connect(function()
if RagdolledBool.Value == true then
script.Parent.Torso.Neck.Enabled = false
script.Parent.Torso["Left Shoulder"].Enabled = false
script.Parent.Torso["Right Shoulder"].Enabled = false
script.Parent.Torso["Left Hip"].Enabled = false
script.Parent.Torso["Right Hip"].Enabled = false
local HRPWeld = Instance.new("WeldConstraint")
HRPWeld.Name = "HRPWeldCon"
HRPWeld.Part0 = script.Parent.Torso
HRPWeld.Part1 = script.Parent.HumanoidRootPart
HRPWeld.Parent = script.Parent
script.Parent.HumanoidRootPart.RootJoint.Enabled = false
script.Parent.Humanoid:ChangeState(Enum.HumanoidStateType.Physics)
else
script.Parent.Torso.Neck.Enabled = true
script.Parent.Torso["Left Shoulder"].Enabled = true
script.Parent.Torso["Right Shoulder"].Enabled = true
script.Parent.Torso["Left Hip"].Enabled = true
script.Parent.Torso["Right Hip"].Enabled = true
script.Parent.HRPWeldCon:Destroy()
script.Parent.HumanoidRootPart.RootJoint.Enabled = true
script.Parent.Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
end
end)