• MadCows Weapons Error
    5 replies, posted
[CODE][ERROR] addons/madcow/lua/weapons/weapon_mad_base/shared.lua:696: Tried to use a NULL entity! 1. __index - [C]:-1 2. unknown - addons/madcow/lua/weapons/weapon_mad_base/shared.lua:696[/CODE] This is the function: [CODE]if (not self.Owner:IsNPC() and self.Weapon:Clip1() < 1) then timer.Simple(self.Owner:GetViewModel():SequenceDuration(), function() if self.Owner and self.Owner:Alive() and self.Weapon:GetOwner():GetActiveWeapon():GetClass() == WeaponModel then -- this is Line 696 self.ActionDelay = CurTime() self:Reload() end end) end [/CODE] I know theres a problem because of the timers from gmod13. But how to fix this?
[QUOTE=Neosinos;41021647]I know theres a problem because of the timers from gmod13. But how to fix this?[/QUOTE] Stop using mad cows.
[QUOTE=Magenta;41030803]Stop using mad cows.[/QUOTE] What weapon pack you using?
[QUOTE=lua_error;41032433]What weapon pack you using?[/QUOTE] None at the moment. I don't use "Swep" packs. I create swords instead.
A quick fix. Just check everything before using it. [code] if (IsValid( self.Owner) and not self.Owner:IsNPC() and self.Weapon:Clip1() < 1) then timer.Simple(self.Owner:GetViewModel():SequenceDuration(), function() if IsValid(self.Owner) and self.Owner:Alive() and IsValid( self.Weapon:GetOwner() ) and IsValid( self.Weapon:GetOwner():GetActiveWeapon()) and self.Weapon:GetOwner():GetActiveWeapon():GetClass() == WeaponModel then self.ActionDelay = CurTime() self:Reload() end end) end [/code]
Thanks! Worked ;)
Sorry, you need to Log In to post a reply to this thread.