[ERROR] lua/recoil.lua:9: attempt to index field 'Primary' (a nil value)
1. fn - lua/recoil.lua:9
2. unknown - addons/ulib/lua/ulib/shared/hook.lua:183
Getting this error with mikus "Fix"
When ever I take out my physicgun
Originally Posted by BigBadWilly
[ERROR] lua/recoil.lua:9: attempt to index field 'Primary' (a nil value)
1. fn - lua/recoil.lua:9
2. unknown - addons/ulib/lua/ulib/shared/hook.lua:183
Getting this error with mikus "Fix"
When ever I take out my physicgun
Send me you're code.
You might need to add a check around the code like
if LocalPlayer():GetActiveWeapon():Primary then
end
Or something like that.
I had this problem as well and that's how I fixed it.
Send me you're code.
You might need to add a check around the code like
if LocalPlayer():GetActiveWeapon():Primary then
end
Or something like that.
I had this problem as well and that's how I fixed it.
hook.Add("Think","Work Bitch",function()
local wep = LocalPlayer():GetActiveWeapon()
if wep.Recoil != 0 then
wep.OldRecoil = wep.Recoil
wep.Recoil = 0
end
if wep.Primary.Recoil != 0 then
wep.Primary.OldRecoil = wep.Primary.Recoil
wep.Primary.Recoil = 0
end
if wep.Secondary.Recoil != 0 then
wep.Secondary.OldRecoil = wep.Secondary.Recoil
wep.Secondary.Recoil = 0
end