Adding "stats" to a weapon

So I’ve seen quite a few servers with this on, and i thought it was pretty cool, so i was wondering how it’s done. They’re basically giving weapons stats such as “50% extra damage”, 20% less recoil and giving the weapon a chance to slow the player you’re shooting at. I don’t want you guys to spoon-feed the code, as i do actually want to learn from it. I just want a little nudge in the right direction.

I highly appreciate your time.

I don’t understand.
‘Giving weapons stats’
Is it a perk you can buy? Or item description? Be more specific

Add a table to a SWEP on spawn or something and then use different hooks to apply the effects according to what’s in the weapon’s table.

Ah, you’re right. I should be more specific. I’m talking about modifying a weapon’s stats like recoil and damage in general, like how it’s done.

I hope you understand what i mean.

[editline]21st July 2015[/editline]

Thanks for your reply. I was wondering if there’s any chance that you could do it, without actually modifying the lua file containing the swep itself.

You can add hooks to damage call backs.

All the chances, you don’t have to edit the weapon files, you can assign any variable to a weapon object after creating (or otherwise getting) it.

Weapons are objects, so each weapon is unique and can be tracked and assigned variables.