Bodygroup reset on reload

I’m currently making a M249 on the TFA Base, so when the player gets below 14 bullets the belt becomes smaller, but whenever I reload the gun the bullets do not reset until the gun is reloaded creating a weird effect.

The gun at full capacity

The gun at low capacity

I’m trying to make it when the player reloads, it waits about 1.5-2 seconds then the belt bodygroup resets back to full capacity.

Any help is appreciated.

EDIT:

SWEP Code: http://hastebin.com/umavicotak.avrasm

Belt bodygroup (Worst code ever please don’t hurt me): http://hastebin.com/udakopanul.coffee

Base: TFA Base

This is not a very elegant solution, and I would avoid using timers and instead use Networked Variables for this, but this is something quick and simple to whip up when you don’t show us any code.

[lua]
timer.Simple(2, function() if IsValid(self.Owner) then self:SetBodygroup(you know the numbers, I don’t) end end)
[/lua]

Timers aren’t very good for SWEPS because they don’t work well for people with bad ping, but they are much easier to make. If you provide full code of your SWEP, I can whip up a home-made timer that IS predicted so it won’t have problems with high pinged players.

Main post updated

Could you provide the base code for TFA too please?

Sure, https://bitbucket.org/TheForgottenArchitect/tfa-base/src/463adebf0d55941361f7580d9eade151b658b7e1/lua/weapons/tfa_gun_base/shared.lua?at=master&fileviewer=file-view-default

Bump