Gamemode.OnPlayerHitGround

From GMod Wiki

Jump to: navigation, search
Event Hook
Hook NameOnPlayerHitGround
SyntaxGM:OnPlayerHitGround( Player player, Boolean bInWater, Boolean bOnFloater, Float flFallSpeed )
DescriptionCalled when a player falls to the ground
ReturnsNil
Lua StateNewerShared.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.OnPlayerHitGround]Gamemode.OnPlayerHitGround [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionMake them explode when they hit the ground.
Used onNewerServer.png
Code
 
function GM:OnPlayerHitGround( pl )
 
     local boom = ents.Create( "env_explosion" )
     boom:SetPos( pl:GetPos( ) )
     boom:Spawn( )
     boom:Fire( "explode", "", 2 )
 
end
OutputAn explosion is created with a delay of 2 seconds everytime a player hits the ground.
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox