I have a physics damage script that activates when the value is set to true, aka ragdolled. Before you even ragdoll, the script works fine, not damaging the limb health regardless of falling from a height. When you ragdoll, it works as intended however if you unragdoll after you ragdolled and just fall from a high place, you will still take limb damage. Now, in the script, it’s set to print out a debug message when Ragdolled.Value == false and it does print, but the limb damage still happens eitherway.
Script:
wait(0.1)
local RagdolledBool = script.Parent.Ragdolled
RagdolledBool:GetPropertyChangedSignal("Value"):Connect(function()
if RagdolledBool.Value == true then
for i, child in ipairs(script.Parent:GetDescendants()) do
if child:IsA("Part") then
child.Touched:connect(function(hit)
if hit.Name ~= "Handle" and child.Name ~= "Handle" and child.Name ~= "Torso" and child.Name ~= "HumanoidRootPart" and hit.Parent ~= script.Parent and child.Velocity.Magnitude >= 50 then
child.BoneHP.Value = math.round(child.BoneHP.Value - child.Velocity.Magnitude)
child.LimbJointHP.Value = math.round(child.LimbJointHP.Value - child.Velocity.Magnitude/4)
child.LimbPhysicalHP.Value = math.round(child.LimbPhysicalHP.Value - child.Velocity.Magnitude/6)
end
end)
end
end
else
print("no more")
end
end)
Thanks to anyone who helped me.