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.


SWEP Code:

Belt bodygroup (Worst code ever please don’t hurt me):

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.

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

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?