Garry's Mod Wiki

GM:PlayerStepSoundTime

  number GM:PlayerStepSoundTime( Player ply, number type, boolean walking )
This hook is predicted. This means that in singleplayer, it will not be called in the Client realm.

Description

Allows you to override the time between footsteps.

See GM:PlayerFootstep for a related hook about footstep sounds themselves.

This hook is called on all clients.

Arguments

1 Player ply
Player who is walking
2 number type
The type of footsteps, see STEPSOUNDTIME enum
3 boolean walking
Is the player walking or not ( +walk? )

Returns

1 number
Time between footsteps, in ms

Example

A Very simple footstep cadence changer. This will change the cadence of the default footsteps.

hook.Add("PlayerStepSoundTime", "SimpleCadence", function(ply, iType, walking) return 500 -- This will change the cadence of the footsteps. Lower number = Slower cadence, Higher number = Faster cadence. end)