Anti-Cheat script, can't figure something out

I’m making a simple anti-cheat script for Lua practice, but can’t figure out the solution to this error.

Since people are assholes, I removed the code.

On line 144 you just put the function name, not the (ply).

Thanks, same error though.

ply is nil you need to set the value of it

First, you’re calling table.Count before calling the table. (You can also use #BannedCommands) exemple: [lua] for i=1, #BannedCommands do
Also, with RunConsoleCommand(), you cannot use command like lua_openscript.

One thing, fap_aim_enabled and fap_esp_enabled are convars, not concommands.




How do I do that?

Sorry, Lua noob.




Also, is it possible to add a hook to when the client changes a cvar?

You could override CreateConVar and return false but you wouldn’t be able to find the player running it.

FapHack will also run before his anticheat, so that wouldn’t work either. Anyway, this isn’t the place for me to boast.



that whole bottem function from line 137 to 144 is useless and its causing the error you may as well remove it

-snipped- by request of Banana Lord

Thanks! I’ve decided to switch to SQL though, so I might come back later when I get most of the code working.

Your whole script interests me, mind if I use/edit it?

As long as somewhere it says I have credits for original concept/parts of the code. Don’t care if it’s in comments or displayed anywhere, just as long as it says it somewhere.

Im using your tables as a base, but other than that I am re-writing the whole script.

That method is unreliable. It means I can insert myself into the whitelist, whitelist my own commands and such.

What is the point of a white-list anyways?
All you can do with it is abuse.

Comes in handy testing things. For example, if I want to add another script onto my server, I can make sure it works on the server without having to update the anticheat.

If you could pm me the anti-cheat also I’d like to learn from it and put it into my new gamemode, and yes I would give you credit for it also. Is there a way to check a person’s variables to that like if aa_enabled = 1 it bans them?

And you aren’t going to release to the public right? Because then people would rewrite their hacks and it would become obsolete…

I wasn’t planning to release it to the public, only a select few people who ask for it.


I think for now I am going to have to send a file to the client so whenever they change a CVAR, if it matches a cheat CVAR they get banned. The current banning system is with ASSMod, but I heard it broke in the update, so I will add a working setting to set the ban system.