iOSdeveloper

Untitled

Jun 25th, 2025
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.43 KB | None | 0 0
  1. local rs=cloneref(game:GetService("ReplicatedStorage"))
  2. local plrs=cloneref(game:GetService("Players"))
  3. local lp=plrs.LocalPlayer
  4. local scanned={}
  5. local maxDepth=800
  6. local depth=0
  7. local hook=hookfunction
  8. local oldFireServer={}
  9. local oldInvokeServer={}
  10. local cloneFlag={}
  11.  
  12. local function notify(msg)
  13. print("[AC Bypass] "..msg)
  14. end
  15.  
  16. local function isRemoteEvent(obj)
  17. return typeof(obj)=="Instance" and obj:IsA("RemoteEvent")
  18. end
  19.  
  20. local function isRemoteFunction(obj)
  21. return typeof(obj)=="Instance" and obj:IsA("RemoteFunction")
  22. end
  23.  
  24. local function isRemote(obj)
  25. return isRemoteEvent(obj) or isRemoteFunction(obj)
  26. end
  27.  
  28. local function shouldBlock(args)
  29. if not args or #args<1 then return false end
  30. local a1=tostring(args[1]):lower()
  31. local num=a1:match("^x%-(%d+)$")
  32. if num then
  33. num=tonumber(num)
  34. if num and num>=10 and num<=30 then
  35. notify("Blocked kick code: "..a1)
  36. return true
  37. end
  38. end
  39. if a1:find("kick") or a1:find("ban") then
  40. notify("Blocked kick/ban command: "..a1)
  41. return true
  42. end
  43. if tonumber(a1) and tonumber(a1)>1000 then
  44. notify("Blocked numeric kick command: "..a1)
  45. return true
  46. end
  47. return false
  48. end
  49.  
  50. local function hookRemoteEvent(remote)
  51. if oldFireServer[remote] then return end
  52. oldFireServer[remote]=hook(remote.FireServer,function(self,...)
  53. local args={...}
  54. if shouldBlock(args) then return task.wait(9e9) end
  55. return oldFireServer[self](self,...)
  56. end)
  57. notify("Hooked RemoteEvent: "..remote:GetFullName())
  58. end
  59.  
  60. local function hookRemoteFunction(remote)
  61. if oldInvokeServer[remote] then return end
  62. oldInvokeServer[remote]=hook(remote.InvokeServer,function(self,...)
  63. local args={...}
  64. if shouldBlock(args) then return task.wait(9e9) end
  65. return oldInvokeServer[self](self,...)
  66. end)
  67. notify("Hooked RemoteFunction: "..remote:GetFullName())
  68. end
  69.  
  70. local function deepScan(val)
  71. if scanned[val] or depth>maxDepth then return end
  72. scanned[val]=true
  73. depth=depth+1
  74. if isRemote(val) then
  75. if not val:IsDescendantOf(rs) then
  76. if isRemoteEvent(val) then hookRemoteEvent(val) elseif isRemoteFunction(val) then hookRemoteFunction(val) end
  77. end
  78. return
  79. end
  80. if typeof(val)=="function" then
  81. local ups=getupvalues(val)
  82. for _,v in pairs(ups) do deepScan(v) end
  83. elseif typeof(val)=="table" then
  84. for _,v in pairs(val) do deepScan(v) end
  85. end
  86. end
  87.  
  88. local function safeHookKick()
  89. pcall(function()
  90. if hook and lp and lp.Kick then
  91. hook(lp.Kick,function() notify("Blocked LocalPlayer Kick") return task.wait(9e9) end)
  92. end
  93. if hook and game.Kick then
  94. hook(game.Kick,function() notify("Blocked game Kick") return task.wait(9e9) end)
  95. end
  96. end)
  97. end
  98.  
  99. safeHookKick()
  100. notify("Hooked Kick functions")
  101.  
  102. for _,v in next,getgc(true) do
  103. if typeof(v)=="function" and islclosure(v) and not isexecutorclosure(v) then deepScan(v) end
  104. end
  105. notify("Completed deep scan and hooked remotes")
  106.  
  107. game.DescendantAdded:Connect(function(obj)
  108. if obj:IsA("LocalScript") and not cloneFlag[obj] then
  109. if obj.Name=="LocalScript " then
  110. obj.Enabled=false
  111. notify("Disabled suspicious LocalScript ")
  112. end
  113. cloneFlag[obj]=true
  114. end
  115. end)
  116.  
Advertisement
Add Comment
Please, Sign In to add comment