In short
Put a Script in ServerScriptService. Every frame in RunService.Heartbeat, read each character's root part: keep the highest Position.Y since it last stood still, and watch AssemblyLinearVelocity.Y. When a fast downward speed suddenly drops, the character has landed: subtract the landing height from the highest point, and call humanoid:TakeDamage((fallen - 20) * 2) if it fell more than 20 studs.
- The server does the counting, so a player cannot switch fall damage off by deleting a LocalScript.
- A normal jump is about 7 studs high and lands at about 53 studs per second, so the safe height has to sit well above that.
- Landing in water slows a fall gradually, so the script checks for water before it hurts anyone.
Get the script
Fall damage script for the server
One Script in ServerScriptService: players who fall more than 20 studs lose 2 health per extra stud when they land, except in water.
-- Script in ServerScriptService named FallDamage.
-- Players lose health when they land after falling further than SAFE_FALL_STUDS.
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local SAFE_FALL_STUDS = 20 -- falls up to this height do no damage
local DAMAGE_PER_STUD = 2 -- health lost for each stud past the safe height
local MIN_LANDING_SPEED = 60 -- studs per second downwards a landing needs (a normal jump lands at about 53)
local FALLING_SPEED = 8 -- below minus this vertical speed, the character counts as falling
local TELEPORT_STUDS = 30 -- a jump bigger than this in one frame is a teleport, not a fall
type FallState = {
peakY: number, -- highest point since the character last stood still vertically
lastY: number,
lastVelocityY: number,
falling: boolean,
}
local states: { [Model]: FallState } = {}
local function isInWater(position: Vector3): boolean
-- Read the terrain voxels around the character; Water there means a soft landing
local region = Region3.new(position - Vector3.new(4, 6, 4), position + Vector3.new(4, 2, 4)):ExpandToGrid(4)
local materials = workspace.Terrain:ReadVoxels(region, 4)
for _, plane in materials do
for _, row in plane do
for _, material in row do
if material == Enum.Material.Water then
return true
end
end
end
end
return false
end
local function onLanded(humanoid: Humanoid, fallen: number, landingSpeed: number, position: Vector3)
if fallen <= SAFE_FALL_STUDS or landingSpeed < MIN_LANDING_SPEED then
return
end
if humanoid.Sit or isInWater(position) then
return
end
local damage = (fallen - SAFE_FALL_STUDS) * DAMAGE_PER_STUD
-- TakeDamage does nothing while the character has a ForceField (spawn protection)
humanoid:TakeDamage(damage)
end
local function update(character: Model)
local humanoid = character:FindFirstChildOfClass("Humanoid")
local root = humanoid and humanoid.RootPart
if not (humanoid and root) or humanoid.Health <= 0 then
return
end
local y = root.Position.Y
local velocityY = root.AssemblyLinearVelocity.Y
local state = states[character]
if not state or math.abs(y - state.lastY) > TELEPORT_STUDS then
-- First frame, or the character was teleported: start counting from here
states[character] = { peakY = y, lastY = y, lastVelocityY = velocityY, falling = false }
return
end
if math.abs(velocityY) < 1 and not state.falling then
state.peakY = y -- standing, or the top of a jump: a fall would start here
elseif y > state.peakY then
state.peakY = y
end
if velocityY < -FALLING_SPEED then
state.falling = true
elseif state.falling and velocityY > state.lastVelocityY * 0.5 then
-- The downward speed dropped by more than half in one step: the character hit something
state.falling = false
onLanded(humanoid, state.peakY - y, -state.lastVelocityY, root.Position)
state.peakY = y
end
state.lastY = y
state.lastVelocityY = velocityY
end
RunService.Heartbeat:Connect(function()
for _, player in Players:GetPlayers() do
local character = player.Character
if character then
update(character)
end
end
end)
-- Forget a character when it is removed, so the table does not grow forever
local function onCharacterAdded(character: Model)
character.AncestryChanged:Connect(function()
if not character:IsDescendantOf(workspace) then
states[character] = nil
end
end)
end
Players.PlayerAdded:Connect(function(player: Player)
player.CharacterAdded:Connect(onCharacterAdded)
end)
for _, player in Players:GetPlayers() do
player.CharacterAdded:Connect(onCharacterAdded)
if player.Character then
onCharacterAdded(player.Character)
end
end
RoCode builds it in the place you have open in Roblox Studio, on Windows or macOS with a desktop browser; on a phone the button sends the prompt and the link to your computer. Free to start, with free credits every day. More Roblox Studio scripts
Where to put it
ServerScriptService
FallDamage Script new
Settings you can change
SAFE_FALL_STUDSIn the script- Falls up to this height do no damage. Default:
20. DAMAGE_PER_STUDIn the script- Health lost for each stud past the safe height. At 2, a 70 stud fall takes 100 health, a full default health bar. Default:
2. MIN_LANDING_SPEEDIn the script- Downward speed, in studs per second, a landing needs to count. A normal jump lands at about 53. Default:
60.
Damage uses TakeDamage, so a character with a ForceField, such as one that just spawned, takes no fall damage.
Type-checked with luau-lsp strict against Roblox's API definitions on 14 November 2026. Not playtested in Studio yet: press Play and watch the Output window before you publish.
Prompt for RoCode
Add fall damage to my game: one Script in ServerScriptService that tracks every player character's highest point and vertical speed each Heartbeat, detects a hard landing when downward speed above 60 studs per second drops by more than half, and deals 2 damage per stud fallen past 20 studs with TakeDamage. Skip landings in terrain water and reset after teleports.
On this page
How fall damage works
Roblox does not track falls for you, so the script measures them. Each frame it reads two numbers from the character's HumanoidRootPart: its height, Position.Y, and its vertical speed, AssemblyLinearVelocity.Y, which is negative while falling.
| Moment | What it sees | What it does |
|---|---|---|
| Standing, or at the top of a jump | Vertical speed close to 0 | Remembers this height as the start of any fall. |
| Going up | Height rising | Keeps the highest point. |
| Falling | Vertical speed below minus 8 | Marks the character as falling. |
| Landing | A fast fall suddenly slows by more than half | Fall distance is the highest point minus the current height. Deals damage. |
You can base the damage on either number. Fall height is easy to reason about when you build a map: "anything over 20 studs hurts". Landing speed also handles things like a jump pad that throws a player down hard. Step 3 shows how to switch.
Step 1: The fall damage Script
- Hover over ServerScriptService in the Explorer, click + and insert a Script. Name it
FallDamage. - Replace its contents with the code below.
- Build a tower at least 40 studs tall, press Play and jump off it.
-- Script in ServerScriptService named FallDamage.
-- Players lose health when they land after falling further than SAFE_FALL_STUDS.
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local SAFE_FALL_STUDS = 20 -- falls up to this height do no damage
local DAMAGE_PER_STUD = 2 -- health lost for each stud past the safe height
local MIN_LANDING_SPEED = 60 -- studs per second downwards a landing needs (a normal jump lands at about 53)
local FALLING_SPEED = 8 -- below minus this vertical speed, the character counts as falling
local TELEPORT_STUDS = 30 -- a jump bigger than this in one frame is a teleport, not a fall
type FallState = {
peakY: number, -- highest point since the character last stood still vertically
lastY: number,
lastVelocityY: number,
falling: boolean,
}
local states: { [Model]: FallState } = {}
local function isInWater(position: Vector3): boolean
-- Read the terrain voxels around the character; Water there means a soft landing
local region = Region3.new(position - Vector3.new(4, 6, 4), position + Vector3.new(4, 2, 4)):ExpandToGrid(4)
local materials = workspace.Terrain:ReadVoxels(region, 4)
for _, plane in materials do
for _, row in plane do
for _, material in row do
if material == Enum.Material.Water then
return true
end
end
end
end
return false
end
local function onLanded(humanoid: Humanoid, fallen: number, landingSpeed: number, position: Vector3)
if fallen <= SAFE_FALL_STUDS or landingSpeed < MIN_LANDING_SPEED then
return
end
if humanoid.Sit or isInWater(position) then
return
end
local damage = (fallen - SAFE_FALL_STUDS) * DAMAGE_PER_STUD
-- TakeDamage does nothing while the character has a ForceField (spawn protection)
humanoid:TakeDamage(damage)
end
local function update(character: Model)
local humanoid = character:FindFirstChildOfClass("Humanoid")
local root = humanoid and humanoid.RootPart
if not (humanoid and root) or humanoid.Health <= 0 then
return
end
local y = root.Position.Y
local velocityY = root.AssemblyLinearVelocity.Y
local state = states[character]
if not state or math.abs(y - state.lastY) > TELEPORT_STUDS then
-- First frame, or the character was teleported: start counting from here
states[character] = { peakY = y, lastY = y, lastVelocityY = velocityY, falling = false }
return
end
if math.abs(velocityY) < 1 and not state.falling then
state.peakY = y -- standing, or the top of a jump: a fall would start here
elseif y > state.peakY then
state.peakY = y
end
if velocityY < -FALLING_SPEED then
state.falling = true
elseif state.falling and velocityY > state.lastVelocityY * 0.5 then
-- The downward speed dropped by more than half in one step: the character hit something
state.falling = false
onLanded(humanoid, state.peakY - y, -state.lastVelocityY, root.Position)
state.peakY = y
end
state.lastY = y
state.lastVelocityY = velocityY
end
RunService.Heartbeat:Connect(function()
for _, player in Players:GetPlayers() do
local character = player.Character
if character then
update(character)
end
end
end)
-- Forget a character when it is removed, so the table does not grow forever
local function onCharacterAdded(character: Model)
character.AncestryChanged:Connect(function()
if not character:IsDescendantOf(workspace) then
states[character] = nil
end
end)
end
Players.PlayerAdded:Connect(function(player: Player)
player.CharacterAdded:Connect(onCharacterAdded)
end)
for _, player in Players:GetPlayers() do
player.CharacterAdded:Connect(onCharacterAdded)
if player.Character then
onCharacterAdded(player.Character)
end
end
Step 2: How it spots a landing
The highest point
A fall starts at the highest point the character reached, not where it was standing. Jump off a ledge and the fall begins at the top of the jump. The script handles that with one rule: while not falling, any frame where the vertical speed is close to 0 resets peakY to the current height. That happens when the character stands on the ground and at the very top of a jump, which are exactly the two places a fall can start. Any higher point after that also raises peakY.
The landing
While falling, the vertical speed keeps getting more negative. Hitting the ground stops it almost at once. The script compares each frame's speed with the frame before: if a character that was falling suddenly loses more than half of its downward speed, it has landed. The landing speed is the speed just before that frame, and the distance fallen is peakY minus the height now.
Landing speed also filters out small drops. With Roblox's default gravity of 196.2 studs per second squared and jump height of 7.2 studs, a normal jump comes down at about 53 studs per second. MIN_LANDING_SPEED is 60, so ordinary jumping can never hurt, even if you lower the safe height.
Water and seats
Water slows a falling character over several frames, so the speed check alone might count a dive into a lake as a landing. Before dealing damage, isInWater reads the terrain voxels around the character with Terrain:ReadVoxels. Roblox's reference says the region has to be aligned to the 4 stud voxel grid, which ExpandToGrid(4) does. If any voxel there is water, no damage. A seated player (humanoid.Sit) is skipped too, so a car going off a ramp does not hurt its driver.
Teleports and respawns
If a character moves more than TELEPORT_STUDS in one frame, that was a teleport, for example from a teleporter pad or a checkpoint. The script starts counting again from the new spot instead of treating the jump as a fall. A respawned character is a new Model, so it gets a fresh state on its first frame.
Step 3: Damage from landing speed instead
To base damage on how hard the player hits the ground, replace the onLanded function in Step 1 with this one. It keeps the same arguments, so nothing else changes.
-- Replacement for onLanded in the FallDamage Script: damage grows with the landing speed.
local SAFE_LANDING_SPEED = 90 -- studs per second; about a 20 stud fall at default gravity
local DAMAGE_PER_SPEED = 1 -- health per stud per second above the safe speed
local function isInWater(_position: Vector3): boolean
return false -- use the isInWater function from Step 1
end
local function onLanded(humanoid: Humanoid, _fallen: number, landingSpeed: number, position: Vector3)
if landingSpeed <= SAFE_LANDING_SPEED or humanoid.Sit or isInWater(position) then
return
end
humanoid:TakeDamage((landingSpeed - SAFE_LANDING_SPEED) * DAMAGE_PER_SPEED)
end
return onLanded
Only paste the onLanded function and the two new settings into FallDamage; the stub and the return line are there so the block checks on its own. Speed grows with the square root of the height: at default gravity, a 20 stud fall lands at about 89 studs per second and a 50 stud fall at about 140. So with speed-based damage, the first studs past the safe point hurt more than the last ones.
| Fall height | Landing speed | Height-based damage (Step 1) |
|---|---|---|
| 7.2 studs (a normal jump) | About 53 | None |
| 20 studs | About 89 | None |
| 40 studs | About 125 | 40 |
| 70 studs | About 166 | 100 |
The speeds come from speed = math.sqrt(2 * gravity * height). If your game changes Workspace.Gravity, the same height lands slower or faster, which is one more reason the height-based version is easier to reason about. The low gravity guide covers gravity changes.
Step 4: Make landings feel heavy
Damage on its own can feel random. A sound and a short camera shake tell the player why their health dropped. The server can play a sound for everyone by putting a Sound in the root part inside onLanded and calling Play on it. A camera shake has to run on the player's device: fire a RemoteEvent from onLanded to that player and shake their camera with the code from the camera shake guide.
For a tall map where you want only some drops to hurt, give the safe areas a kill brick style tag check instead: skip damage in onLanded when the part below the player has a tag such as SoftLanding, found with a short raycast down from the root part.
Step 5: Test it
- Build three platforms: 15, 40 and 80 studs high. Anchor them.
- Press Play and wait 10 seconds so the spawn ForceField runs out.
- Jump off the 15 stud platform: no damage. Off 40: you lose about 40 health. Off 80: you die.
- Jump around on flat ground for a while: you should never lose health.
- Add terrain water at the bottom of the tall platform and jump into it: no damage.
- To see the numbers, add
print(fallen, landingSpeed)as the first line ofonLandedand watch the Output window.
Common errors and fixes
If falls do nothing, add a print to onLanded first and watch the Output window.
No damage at all
Check that FallDamage is a Script in ServerScriptService. Then wait out the spawn ForceField: TakeDamage does nothing while it is on. Set the SpawnLocation's Duration to 0 to remove it.
Players take damage from normal jumps
SAFE_FALL_STUDS or MIN_LANDING_SPEED is too low. Keep MIN_LANDING_SPEED above 53, the landing speed of a normal jump, or raise the jump height and this number together.
Players die after a teleport
The teleport moved them less than TELEPORT_STUDS in one frame and then they fell. Raise TELEPORT_STUDS, or teleport them onto a floor instead of into the air.
Damage on landing in a pool made of parts
The water check only looks at terrain water. For a pool made of parts, tag the pool and skip damage when the part under the player has that tag, as Step 4 describes.
Build it with RoCode
If you would rather not set this up by hand, RoCode can build it in the place you have open. RoCode is an independent AI agent for Roblox Studio, not made by Roblox: you describe the change in a web chat, and its Studio plugin creates the parts and scripts in your Explorer, so there is no code to paste.
Add fall damage to my survival game: falls over 25 studs hurt, a 70 stud fall kills, landing in water is safe, and play a thud sound on hard landings.
- Can read your place first to find your existing scripts, then adds the server Script next to them
- Writes the scripts with Create Script and is told to compile-check each one with Check Script
- Sets an undo point before and after each batch of changes, so Ctrl+Z steps back one batch at a time
After a build, RoCode can run its test robot: it plays your game in Studio and reports PASS or FAIL. It checks only what it chose to test, so jump off a few ledges yourself too. How RoCode connects to Studio.
Questions
How do you add fall damage in Roblox Studio?
Use a Script in ServerScriptService that tracks each character's highest point and vertical speed every Heartbeat, detects the landing, and calls Humanoid:TakeDamage for the distance past a safe height. Step 1 has the full script.
Should fall damage be on the server or the client?
On the server. A LocalScript can be deleted by a cheater, and the server already receives every character's position and speed.
How do I calculate fall damage from height?
Fall distance is the highest point minus the landing height. Damage is (distance - SAFE_FALL_STUDS) * DAMAGE_PER_STUD when the distance is over the safe height.
Why is there no fall damage right after I spawn?
The SpawnLocation gives a ForceField for 10 seconds by default, and TakeDamage does nothing through it.
Can I use Humanoid.StateChanged for fall damage?
Many tutorials listen for the Freefall and Landed states. That runs best in a LocalScript, because the player's device controls the character. This guide uses position and speed so the server can do it alone.
Sources and further reading
- Roblox Creator Docs: BasePart. AssemblyLinearVelocity and Position
- Roblox Creator Docs: Humanoid. TakeDamage, which does nothing through a ForceField, and Sit
- Roblox Creator Docs: Terrain. ReadVoxels and its grid rule
- Roblox Creator Docs: Workspace. Gravity, 196.2 by default
How the code was checked: every script on this page passes Luau's strict type checker against Roblox's API definitions (luau-lsp, 14 November 2026). A type check catches misspelt APIs and wrong types, not game logic, so playtest in Studio before you publish.