Ok so can someone explain to me?

When you mod from a gun to another gun, does the stat change with it?

or is it server sided? Or only the visual of the gun change.

Can someone confirm this plx thx