Garry's Mod Wiki

Player:StopSprinting

  Player:StopSprinting()

Description

We advise against using this. It may be changed or removed in a future update. This appears to be a direct binding to internal functionality that is overridden by the engine every frame so calling these functions may not have any or expected effect.

When used in a GM:SetupMove hook, this function will prevent the player from sprinting.

When +walk is engaged, the player will still be able to sprint to half speed (normal run speed) as opposed to full sprint speed without this function.

Example

Example usage, disables sprinting at all times.

hook.Add( "SetupMove", "TestFunc", function( ply, mv, cmd ) ply:StopSprinting() end )