Not sure why but when I climb down ladders I will recive fall damage. I guess since im moving down at any point i will loose health. I'm just wondering how I can make it so that someone would only loose health for falling
will that work with a custom falling anim , i seen some tutorials but my falling anim is breaking all of the scripts [killing height needs to be one to work] and the script that work are rounded up so they deal 20 or 100 which i dont like
@@anotherpolosh yea it should. It doesn’t rely on any humanoid events or animation events to work. You can also customize the distance to fall that doesn’t cause any damage, as well as a damage multiplier so you can really tinker it to your liking. I don’t see why you couldn’t use a custom fall animation. It reads the characters humanoidrootpart’s velocity to detect when to apply damage
@@duckhive-games also i do not have time to check may u check is something is wrong here , it doesnt work but there is 0 errors : local Players = game:GetService("Players") local RunService = game:GetService("RunService")
local fallThreshold = 20 local damageMultiplier = 2
Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) local humanoid = character:WaitForChild("humanoid") local rootPart = character:WaitForChild("humanoidRootPart")
local isFalling = false local startHeight = nil
RunService.Heartbeat:Connect(function() if humanoid and rootPart then local velocityY = rootPart.Velocity.Y
if velocityY >= 0 then isFalling = false
end
if velocityY < -5 and not isFalling then isFalling = true startHeight = rootPart.Position.Y print("Started falling from height:", startHeight)
end end end)
rootPart.Touched:Connect(function(hit) if isFalling and hit:IsDescendantOf(workspace) and not hit:IsDescendantOf(character)then local endHeight = rootPart.Position.Y local fallDistance = startHeight - endHeight
if fallDistance > fallThreshold then local damage = (fallDistance - fallThreshold) + damageMultiplier humanoid:TakeDamage(damage) print("Landed from fall. Distance", fallDistance, "Damage applied", damage) end
isFalling = false startHeight = nil end end) end) end)
Your videos help me understand studio much better.
Glad to hear that!
Not sure why but when I climb down ladders I will recive fall damage. I guess since im moving down at any point i will loose health. I'm just wondering how I can make it so that someone would only loose health for falling
Script?
will that work with a custom falling anim , i seen some tutorials but my falling anim is breaking all of the scripts [killing height needs to be one to work] and the script that work are rounded up so they deal 20 or 100 which i dont like
@@anotherpolosh yea it should. It doesn’t rely on any humanoid events or animation events to work. You can also customize the distance to fall that doesn’t cause any damage, as well as a damage multiplier so you can really tinker it to your liking. I don’t see why you couldn’t use a custom fall animation. It reads the characters humanoidrootpart’s velocity to detect when to apply damage
@@duckhive-games also i do not have time to check may u check is something is wrong here , it doesnt work but there is 0 errors : local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local fallThreshold = 20
local damageMultiplier = 2
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local humanoid = character:WaitForChild("humanoid")
local rootPart = character:WaitForChild("humanoidRootPart")
local isFalling = false
local startHeight = nil
RunService.Heartbeat:Connect(function()
if humanoid and rootPart then
local velocityY = rootPart.Velocity.Y
if velocityY >= 0 then
isFalling = false
end
if velocityY < -5 and not isFalling then
isFalling = true
startHeight = rootPart.Position.Y
print("Started falling from height:", startHeight)
end
end
end)
rootPart.Touched:Connect(function(hit)
if isFalling and hit:IsDescendantOf(workspace) and not hit:IsDescendantOf(character)then
local endHeight = rootPart.Position.Y
local fallDistance = startHeight - endHeight
if fallDistance > fallThreshold then
local damage = (fallDistance - fallThreshold) + damageMultiplier
humanoid:TakeDamage(damage)
print("Landed from fall. Distance", fallDistance, "Damage applied", damage)
end
isFalling = false
startHeight = nil
end
end)
end)
end)