Garry's Mod Wiki

Revision Difference

gameevent/break_prop#548565

<cat>gameevent</cat>⤶ <title>break_prop</title>⤶ ⤶ <structure>⤶ <realm>Shared</realm>⤶ <description>⤶ Called when a prop_dynamic or prop_physics is broken by a player.⤶ </description>⤶ <fields>⤶ <item type="string" name="entindex">The <page text="EntIndex">Entity:EntIndex</page> of the broken prop.</item>⤶ <item type="number" name="userid">The <page text="UserID">Player:UserID</page> of the connected player. Seems to be 0 every time.</item>⤶ </fields>⤶ </structure>⤶ ⤶ # Examples⤶ <example>⤶ <description>This is a basic template with the purpose of including all arguments / table variables to make it easily known which values can be accessed.</description>⤶ <code>⤶ gameevent.Listen( "break_prop" )⤶ hook.Add( "break_prop", "break_prop_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.⤶ ⤶ // Called when a prop_dynamic or prop_physics is broken by a player.⤶ ⤶ end )⤶ </code>⤶ </example>