Garry's Mod Wiki

break_breakable

Description

Called when a func_break is broken by a player.

Members

number entindex
The EntIndex of the broken prop.
number userid
The UserID of the connected player.
number material
Material index of the broken entity.

Examples

Example

This is a basic template with the purpose of including all arguments / table variables to make it easily known which values can be accessed.

gameevent.Listen( "break_breakable" ) hook.Add( "break_breakable", "break_breakable_example", function( data ) local entindex = data.entindex // The Entity:EntIndex() of the broken Prop. local userid = data.userid // The UserID of the connected Player. Seems to be 0 every time. local material = data.material // The Material index of the broken entity. // Called when a func_break is broken by a player. end )