Garry's Mod Wiki

Revision Difference

GM:PlayerFootstep#511110

<function name="PlayerFootstep" parent="GM" type="hook">⤶ <ishook>yes</ishook>⤶ <description>Called whenever a player steps. Return true to mute the normal sound.</description>⤶ <realm>Shared</realm>⤶ <predicted>No</predicted>⤶ <hidepredictionwarning>No</hidepredictionwarning>⤶ <args>⤶ <arg name="ply" type="Player">The stepping player</arg>⤶ <arg name="pos" type="Vector">The position of the step</arg>⤶ <arg name="foot" type="number">Foot that is stepped. 0 for left, 1 for right</arg>⤶ <arg name="sound" type="string">Sound that is going to play</arg>⤶ <arg name="volume" type="number">Volume of the footstep</arg>⤶ <arg name="filter" type="CRecipientFilter">The Recipient filter of players who can hear the footstep</arg>⤶ </args>⤶ <rets>⤶ <ret name="" type="boolean">Prevent default step sound</ret>⤶ </rets>⤶ </function>⤶ ⤶ <example>⤶ <description>Disables default player footsteps and plays custom ones.</description>⤶ <code>⤶ function GM:PlayerFootstep( ply, pos, foot, sound, volume, rf ) ⤶ ply:EmitSound("NPC_Hunter.Footstep") -- Play the footsteps hunter is using⤶ return true -- Don't allow default footsteps⤶ end⤶ </code>⤶ ⤶ </example>