Garry's Mod Wiki



  Entity:TakeDamageInfo( CTakeDamageInfo damageInfo )


Applies the damage specified by the damage info to the entity.

Calling this function on the victim entity in ENTITY:OnTakeDamage can cause infinite loops.


1 CTakeDamageInfo damageInfo
The damage to apply.


Dissolve the target into oblivion.

If you just want to dissolve your SENT, you may need to use env_entity_dissolver for this.

function DissolveIt( ent, ply ) local d = DamageInfo() d:SetDamage( ent:Health() ) d:SetAttacker( ply or ent ) d:SetDamageType( DMG_DISSOLVE ) ent:TakeDamageInfo( d ) end concommand.Add( "dissolve_it", function( ply, cmd, arg ) local ent = ply:GetEyeTrace().Entity if ( !IsValid( ent ) ) then return end -- Not looking at a valid entity DissolveIt( ent, ply ) end )

Special Pages



Render Time: 23ms

DB GetPage 3
Generate Html 4
SaveChanges (1) 7
Render Body 0
Render Sidebar 8