Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local rs=cloneref(game:GetService("ReplicatedStorage"))
- local plrs=cloneref(game:GetService("Players"))
- local lp=plrs.LocalPlayer
- local scanned={}
- local maxDepth=800
- local depth=0
- local hook=hookfunction
- local oldFireServer={}
- local oldInvokeServer={}
- local cloneFlag={}
- local function notify(msg)
- print("[AC Bypass] "..msg)
- end
- local function isRemoteEvent(obj)
- return typeof(obj)=="Instance" and obj:IsA("RemoteEvent")
- end
- local function isRemoteFunction(obj)
- return typeof(obj)=="Instance" and obj:IsA("RemoteFunction")
- end
- local function isRemote(obj)
- return isRemoteEvent(obj) or isRemoteFunction(obj)
- end
- local function shouldBlock(args)
- if not args or #args<1 then return false end
- local a1=tostring(args[1]):lower()
- local num=a1:match("^x%-(%d+)$")
- if num then
- num=tonumber(num)
- if num and num>=10 and num<=30 then
- notify("Blocked kick code: "..a1)
- return true
- end
- end
- if a1:find("kick") or a1:find("ban") then
- notify("Blocked kick/ban command: "..a1)
- return true
- end
- if tonumber(a1) and tonumber(a1)>1000 then
- notify("Blocked numeric kick command: "..a1)
- return true
- end
- return false
- end
- local function hookRemoteEvent(remote)
- if oldFireServer[remote] then return end
- oldFireServer[remote]=hook(remote.FireServer,function(self,...)
- local args={...}
- if shouldBlock(args) then return task.wait(9e9) end
- return oldFireServer[self](self,...)
- end)
- notify("Hooked RemoteEvent: "..remote:GetFullName())
- end
- local function hookRemoteFunction(remote)
- if oldInvokeServer[remote] then return end
- oldInvokeServer[remote]=hook(remote.InvokeServer,function(self,...)
- local args={...}
- if shouldBlock(args) then return task.wait(9e9) end
- return oldInvokeServer[self](self,...)
- end)
- notify("Hooked RemoteFunction: "..remote:GetFullName())
- end
- local function deepScan(val)
- if scanned[val] or depth>maxDepth then return end
- scanned[val]=true
- depth=depth+1
- if isRemote(val) then
- if not val:IsDescendantOf(rs) then
- if isRemoteEvent(val) then hookRemoteEvent(val) elseif isRemoteFunction(val) then hookRemoteFunction(val) end
- end
- return
- end
- if typeof(val)=="function" then
- local ups=getupvalues(val)
- for _,v in pairs(ups) do deepScan(v) end
- elseif typeof(val)=="table" then
- for _,v in pairs(val) do deepScan(v) end
- end
- end
- local function safeHookKick()
- pcall(function()
- if hook and lp and lp.Kick then
- hook(lp.Kick,function() notify("Blocked LocalPlayer Kick") return task.wait(9e9) end)
- end
- if hook and game.Kick then
- hook(game.Kick,function() notify("Blocked game Kick") return task.wait(9e9) end)
- end
- end)
- end
- safeHookKick()
- notify("Hooked Kick functions")
- for _,v in next,getgc(true) do
- if typeof(v)=="function" and islclosure(v) and not isexecutorclosure(v) then deepScan(v) end
- end
- notify("Completed deep scan and hooked remotes")
- game.DescendantAdded:Connect(function(obj)
- if obj:IsA("LocalScript") and not cloneFlag[obj] then
- if obj.Name=="LocalScript " then
- obj.Enabled=false
- notify("Disabled suspicious LocalScript ")
- end
- cloneFlag[obj]=true
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment