Setting walk/run speeds for specific weapons.

I am trying to set the walk/run speed to be slower when a weapon, such as the Sledge Hammer, is equipped. I’ve tried a ton of commands with no success. I’m attempting to put it as an “if” statement in the init.lua file for my game mode. A few times i even attempted to put it in the coding for that weapon, but with no success. Please if someone knows a way to change the walk/run speed when a specific weapon is equipped, i’d very much appreciate it. Thanks in advance.


How would i get that to work for the sledge hammer only?

I atually just did something like this
I dont think its the most efficiant way but it works
function CLASS:Think( pl )
local wep = pl:GetActiveWeapon()
if(pl:Alive()) then
if(wep:GetClass() == “weapon_knife”) then
[/Lua]thats basically saying that if the player has a knife fun faster else run normal speed


Oh and this is for fretta so You might have to change it slightly for a just a normal gamemode

If it’s an SWEP, you’re better off doing it in SWEP:Deploy and SWEP:Holster.

Read my post.