Garry's Mod Wiki

GM:PlayerFootstep

  boolean GM:PlayerFootstep( Player ply, Vector pos, number foot, string sound, number volume, CRecipientFilter filter )
This hook is predicted. This means that in singleplayer, it will not be called in the Client realm.

Description

Called whenever a player steps. Return true to mute the normal sound.

See GM:PlayerStepSoundTime for a related hook about footstep frequency.

This hook is called on all clients.

Arguments

1 Player ply
The stepping player
2 Vector pos
The position of the step
3 number foot
Foot that is stepped. 0 for left, 1 for right
4 string sound
Sound that is going to play
5 number volume
Volume of the footstep
6 CRecipientFilter filter
The Recipient filter of players who can hear the footstep

Returns

1 boolean
Prevent default step sound

Example

Disables default player footsteps and plays custom ones.

hook.Add( "PlayerFootstep", "CustomFootstep", function( ply, pos, foot, sound, volume, rf ) ply:EmitSound( "NPC_Hunter.Footstep" ) -- Play the footsteps hunter is using return true -- Don't allow default footsteps, or other addon footsteps end )