Garry's Mod Wiki

Revision Difference

GM:PropBreak#511192

<function name="PropBreak" parent="GM" type="hook">⤶ <ishook>yes</ishook>⤶ <description>Called when a prop has been destroyed.</description>⤶ <realm>Shared</realm>⤶ <args>⤶ <arg name="attacker" type="Player">The person who broke the prop.</arg>⤶ <arg name="prop" type="Entity">The entity that has been broken by the attacker.</arg>⤶ </args>⤶ </function>⤶ ⤶ <example>⤶ <description>This kills a player when a person breaks a prop (i.e. a wooden crate).</description>⤶ <code>⤶ hook.Add("PropBreak", "PropVengeance", function(client, prop)⤶ client:Kill()⤶ end)⤶ </code>⤶ ⤶ </example>