Timer Failed! [Simple][@addons/dicksoutforharambe/lua/weapons/fnx_45/shared.lua (line 39)]
[CODE]function SWEP:Reload()
if ( self:Ammo1() <= 0 ) then return end
if ( self.Weapon:Clip1() >= 13 ) then
return
end
if ( self.Weapon:Clip1() >= 0 ) then
self.Weapon:DefaultReload( ACT_VM_RELOAD )
timer.Simple(0.5,function() self.Weapon:EmitSound("weapons/fnx45/5.wav") end)
timer.Simple(1.2,function() self.Weapon:EmitSound("weapons/fnx45/4.wav") end)
timer.Simple(1.77,function() self.Weapon:EmitSound("weapons/fnx45/6.wav") end)
timer.Simple(0.0,function() self.Owner:ViewPunch( Angle(-1,-2,-1) ) end)
timer.Simple(0.5,function() self.Owner:ViewPunch( Angle(2,-2.5,-1) ) end)
timer.Simple(1.2,function() self.Owner:ViewPunch( Angle(-1.5,-1.5,1) ) end)
timer.Simple(1.77,function() self.Owner:ViewPunch( Angle(-1,1,1) ) end)
end
end[/CODE]\
Only happens when you die when reloading
Just add IsValid checks to the timers.
Like:
[code]timer.Simple(1, function()
if IsValid(self) and IsValid(self.Owner) then
-- do something
end
end)[/code]
[QUOTE=markusmarkusz;51208695]Just add IsValid checks to the timers.
Like:
[code]timer.Simple(1, function()
if IsValid(self) and IsValid(self.Owner) then
-- do something
end
end)[/code][/QUOTE]
I honestly love you
Sorry, you need to Log In to post a reply to this thread.