I know I'm bad at phrasing titles, but my point is that whenever the character is in a Y-axis of (0,-1,0) and below, it just automatically dies. I do not know at all why! Also, in some general cases, the character just dies for unkown reasons because of fall damage. If you can help me improve this script or create an entirely new one, it would be a great help. (This was taken from free models and edited from me so I could learn)
wait(5)
bin = script.Parent
probability = math.random(-2, 10)
humanoid = bin:FindFirstChild("Humanoid")
ll = bin:FindFirstChild("Left Leg")
rl = bin:FindFirstChild("Right Leg")
la = bin:FindFirstChild("Left Arm")
ra = bin:FindFirstChild("Right Arm")
h = bin:FindFirstChild("Head")
freefall = false
startingHeight = 0
endingHeight = 0
ll.Elasticity = 0
rl.Elasticity = 0
la.Elasticity = 0
ra.Elasticity = 0
h.Elasticity = 0
bin.Torso.Elasticity = 0
function onFreeFall()
freefall = true
wait(.25)
startingHeight = bin.Torso.Position.y
end
function onTouched(part) --The ground has been touched.
if freefall == true and bin:findFirstChild("Parachute") == nil and humanoid.Health > 0 and part.CanCollide == true then
endingHeight = bin.Torso.Position.y
local averageHeight = startingHeight - endingHeight
if averageHeight > 25 then
if bin:FindFirstChild("Torso") and bin.Torso:FindFirstChild("Crunch") then
bin.Torso.Crunch:Play()
end
humanoid.Health = humanoid.Health - ((averageHeight * 0.1)^2)
startingHeight = 0
end
end
end
humanoid.FreeFalling:connect(onFreeFall)
ll.Touched:connect(onTouched)
rl.Touched:connect(onTouched)
la.Touched:connect(onTouched)
ra.Touched:connect(onTouched)
h.Touched:connect(onTouched)

1 comment
man. I already know this doesnt work. You use GetAllChildren().