Advertisement
Friks12829

AntiConsoleCommands

Dec 25th, 2022 (edited)
232,750
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. local charset = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890"
  2. math.randomseed(os.clock())
  3. function randomString(length)
  4.     local ret = {}
  5.     local r
  6.     for i = 1, length do
  7.         r = math.random(1, #charset)
  8.         table.insert(ret, charset:sub(r, r))
  9.     end
  10.     return table.concat(ret)
  11. end
  12.  
  13. local id = math.random(100000000,999999999)
  14. local chars = randomString(6)
  15. _G["RRunConsoleCommand"..id..chars] = _G["RRunConsoleCommand"..id..chars] or _G["RunConsoleCommand"]
  16.  
  17. local blacklist = {
  18.     ["lua_dumptimers_sv"] = true,
  19. }
  20.  
  21. _G["RunConsoleCommand"] = function(name, ...)
  22.     if blacklist[name] then return end
  23.  
  24.     _G["RRunConsoleCommand"..id..chars](name, ...) 
  25. end
  26.  
  27. debug.getregistry()[2].RunConsoleCommand = _G["RunConsoleCommand"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement