attempt to call method 'GetActiveWeapon' [Mad Cow Weapons]

my console.log is getting spammed by this error:

[gamemodes**\entities\weapons\weapon_mad_base\shared.lua:403] attempt to call method ‘GetActiveWeapon’ (a nil value)

and it makes my server lag like a baby, any lua king out there that can help me?, il fucking love you if you help me to solve this

[LUA]function SWEP:Think()

self:SecondThink()

if self.Weapon:Clip1() > 0 and self.IdleDelay < CurTime() and self.IdleApply then
    local WeaponModel = self.Weapon:GetOwner():GetActiveWeapon():GetClass()  <---- this is line 403[/LUA]

self.Weapon:GetOwner() should be self.Owner

so i replace

self.Weapon:GetOwner()

with just self.Owner ?

Indeed.

i will try it, thanks

Actually, looking at the code again you are using :GetActiveWeapon() this will always be self since the SWEP’s think function will only be called when the SWEP is out.