Garry's Mod Wiki

Garry's Mod Wiki

  number GM:GetFallDamage( Player ply, number speed )

Description

Called when a player takes damage from falling, allows to override the damage.

Arguments

1 Player ply
The player
2 number speed
The fall speed

Returns

1 number
New fall damage

Example

The player takes a realistic amount of damage when they fall. Fall damage becomes the fall speed divided by 8.

hook.Add( "GetFallDamage", "RealisticDamage", function( ply, speed ) return ( speed / 8 ) end )

Example

Closely approximates the Counter-Strike: Source fall damage.

hook.Add( "GetFallDamage", "CSSFallDamage", function( ply, speed ) return math.max( 0, math.ceil( 0.2418 * speed - 141.75 ) ) end )

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated twice a day. Edits and history are not available.

Last Parsed: Loading...