Garry's Mod Wiki

GM:CreateClientsideRagdoll

  GM:CreateClientsideRagdoll( Entity entity, Entity ragdoll )

Description

Called whenever an entity becomes a clientside ragdoll.

See GM:CreateEntityRagdoll for serverside ragdolls.

Arguments

1 Entity entity
The Entity that created the ragdoll
2 Entity ragdoll
The ragdoll being created.

Example

A way of fade out a ragdoll easily. Idea from here.

hook.Add( "CreateClientsideRagdoll", "fade_out_corpses", function( entity, ragdoll ) ragdoll:SetSaveValue( "m_bFadingOut", true ) -- Set the magic internal variable that will cause the ragdoll to immediately start fading out end )