Exiting scope after primary fire

Right so I’m working on a bolt action rifle, but I’m a bit of a noob with lua…

Could someone possibly help me out here? I’m wanting to do it so that, it exits the scope after firing, then after the reload animation it would bring it back up, like in CS:S…
How could I do it? Thanks in advance

Look into CS:S Realistic Weapons and see how it’s done there.

[LUA]self:SetIronsights(false, self.Owner)[/LUA]