I’m trying to make a ragdoll function, the ragdoll part works but the limb’s (Left arm, leg. Right arm, and leg) CanCollide property isn’t getting set to true. I have put print statements inside to see if it is even running and getting referenced and if it is correct. I have attempted this on mainly a Rig and another Player but no luck. Any help would be appreciated since I don’t know much about this sort of stuff.
for _, v in pairs(humanoid.Parent:GetDescendants()) do
if v:IsA("Motor6D") then
local Attachment0, Attachment1 = Instance.new("Attachment"), Instance.new("Attachment")
Attachment0.CFrame = v.C0
Attachment1.CFrame = v.C1
Attachment0.Parent = v.Part0
Attachment1.Parent = v.Part1
-- Store the original properties
originalProperties[v] = {
Attachment0 = Attachment0,
Attachment1 = Attachment1,
Parent = v.Parent
}
local BSC = Instance.new("BallSocketConstraint")
BSC.Attachment0 = Attachment0
BSC.Attachment1 = Attachment1
BSC.Parent = v.Parent
v:Destroy()
elseif v.Name ~= "HumanoidRootPart" and v.Name ~= "Torso" and v.Name ~= "Head" and v.Name == "Left Arm" or v.Name == "Right Arm" or v.Name == "Left Leg" or v.Name == "Right Leg" then
humanoid.PlatformStand = true
wait(0.1)
v.CanCollide = true
wait(1)
v.CanCollide = false
wait(0.1)
humanoid.PlatformStand = false
end
end
I can also include the full script if needed