Hello, I have this script that allows to cause damage when we fall from a certain height, but I have another script that allows to Ragdoll the character, my question is, how to ensure that my damage script does not take not take into account the ragdoll? because when the ragdoll character he takes no damage.
local MaxVelocity = script:GetAttribute("MaxVelocity")
local MinVelocity = script:GetAttribute("MinVelocity")
game.Players.PlayerAdded:Connect(function(Plr)
Plr.CharacterAdded:Connect(function(Char)
local Humanoid = Char:WaitForChild("Humanoid")
local HumanoidRootPart = Char:WaitForChild("HumanoidRootPart")
Humanoid.StateChanged:Connect(function(OldState, NewState)
local PlrVelocity = HumanoidRootPart.Velocity.Y
PlrVelocity *= -1
if PlrVelocity > MaxVelocity then
Humanoid.Health = 0
elseif PlrVelocity > MinVelocity then
Humanoid.Health -= PlrVelocity / 15
end
end)
end)
end)