Garry's Mod Wiki

Revision Difference

Entity:BecomeRagdollOnClient#527928

<function name="BecomeRagdollOnClient" parent="Entity" type="classfunc"> <description> Spawns a clientside ragdoll for the entity, positioning it in place of the original entity, and makes the entity invisible. It doesn't preserve flex values (face posing) as CSRagdolls don't support flex. It does not work on players. Use <page>Player:CreateRagdoll</page> instead. The original entity is not removed, and neither are any ragdolls previously generated with this function. To make the entity re-appear, run <page>Entity:SetNoDraw</page>( false ) </description> <realm>Client</realm> <rets> <ret name="" type="CSEnt">The created ragdoll.</ret> </rets> </function> <example> <description>Spawns a ragdoll for all NPCs.</description> <code> for k,npc in pairs( ents.FindByClass( "npc_*" ) ) do for i, npc in ipairs( ents.FindByClass( "npc_*" ) ) do npc.RagDoll = npc:BecomeRagdollOnClient() end </code> </example>