Closed Adrianmcmastergaming closed 2 years ago
I have the same error occurring as well. Seems to be caused due to not checking if QBCore.Shared.Weapons[index]
is nil or not. Since QBCore.Shared.Weapons
is a table and not a function, giving it an index that doesn't exist (i.e if CurrentWeapon
is zero or doesn't exist in the table) causes the variable to be nil, which results in WeaponInformation being a nil value, instead of a table.
To fix, simply add:
if WeaponInformation then
end
around line 173.
However, this is probably not the correct usage. If the client is reporting a weapon not in the QBCore Shared Weapons table, it needs to be handled properly... But it stops the error, which is important. If this error occurs, it stops the weapon checking loop altogether, resulting in the weapon anticheat not functioning.
Hi, I have an error that keeps cropping up on the client-side of the anticheat as displayed in the screenshot. I read throw the script but do not understand why the error appears,
This is what is in the client file from lines 173 to 183. Is it trying to flag players with weapons? My job is set as police and I have police weapons so should not be flagging me. I do not understand what is going on or how to fix the error.
end)