Run faster with lighter weapons and slower with heavy weapons equiped

I can’t find how to do this using the documentation as there is no hook for when the player switches a weapon.

The only way I can think of: take weapon switching into my own hands by giving and taking weapons when a certain button is pressed. Any ideas?

Edit: By the way, I’m using default weapons. SWEPs do have a deploy hook.

Use PlayerFootStep, make a static variable compare it with your current weapon and then it should work. It might not be the most optimized way but just giving an idea.

My idea is every time SWEP:Deploy() is called, have it call your own custom function which then checks the weapon and sets the player’s speed to what you want. And on SWEP:Holster() make it set to default.