Closed svensis closed 8 years ago
Maybe your SWEP's don't have any recoil set meaning the value returned would be nil or empty all i can say is try changing the code to this and let me know if it works for you.
if pl:GetActiveWeapon().Primary.KickUp then
if pl:GetActiveWeapon().Primary.KickDown then
if pl:GetActiveWeapon().Primary.Recoil then
if pl:GetActiveWeapon().Secondary.KickUp then
if pl:GetActiveWeapon().Secondary.KickDown then
if pl:GetActiveWeapon().Secondary.Recoil then
Change those following lines to look like this
if pl:GetActiveWeapon().Primary.KickUp != nil then
if pl:GetActiveWeapon().Primary.KickDown != nil then
if pl:GetActiveWeapon().Primary.Recoil != nil then
if pl:GetActiveWeapon().Secondary.KickUp != nil then
if pl:GetActiveWeapon().Secondary.KickDown != nil then
if pl:GetActiveWeapon().Secondary.Recoil != nil then
Its the default HL2 weapons
Yeah it is most likely because I forgot to account for the fact some weapons may not have a recoil method set or attached to them via their SWEP.
Make the changes to the code I provided and it should fix your issue or you can go and make a SWEP file / edit the default HL2 weapons and create a recoil method but i think my fix would be better since some weapons recoil is not needed on and it would be weird to have to make every weapon have recoil when allot do not need it.
I edited my main code anyway should solve it for you https://github.com/C0nw0nk/Garrys-Mod-Anti-Cheat/commit/6cf81de05d86051a1eeae239d68791b6fb6155a3
Infact, I dont think you cant edit the HL2 weapons, as they're inside the .pak files or something along the lines of that. but anyways, thanks your anticheat has saved my server alot
No problem I recommend Cake Anti Cheat it may not have some things I put into mine like Anti Bhop and Anti Recoil as well as the fix for ladder abuse, Anti Speed Hack etc but you will find it has allot more to offer.
It helps to catch the skids, if they really really really want to hack, let them. atleast, thats how i think.
Well Cake, ULX Admin combined with this https://github.com/C0nw0nk/Garrys-Mod-Family-Sharing you can wave goodbye to them.
screencap is the best anticheat, I have serverguard's it is amaizing
[ERROR] addons/anticheat/lua/autorun/server/anti-recoil.lua:20: attempt to index field 'Primary' (a nil value)
it spamming console and its wierd, thanks!
https://i.gyazo.com/5abe24b0158fe4482325e0dab9d41824.png
im running sandbox and i have addons
addon list https://gyazo.com/5a2796804bfaad77975742d19e0b88f5