Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local folder = game:GetService("RobloxReplicatedStorage"):FindFirstChild("REMOTESPYFOLDER_P")
- local enabled = {
- BindableEvent = folder.bindableevent.Value;
- BindableFunction = folder.bindablefunc.Value;
- RemoteEvent = folder.remoteevent.Value;
- RemoteFunction = folder.remotefunc.Value;
- }
- local EXTERNAL_LOGGING = folder.external_logging.Value;
- local IGNORE_LIST = folder.ignore_list.Value;
- local ignore = {
- -- Any remotes matching the names listed below will be ignored
- }
- local meta,oldmeta = getrawmetatable(game),{}
- changereadonly(meta, false)
- for i,v in next,meta do oldmeta[i] = v end
- function formatargs(args,showkeys)
- if #args == 0 then return "N/A" end
- local strargs = {}
- for k,v in next,args do
- local argstr = ""
- if type(v) == "string" then
- argstr = "\"" .. v .. "\""
- elseif type(v) == "table" then
- argstr = "{" .. formatargs(v,true) .. "}"
- else
- argstr = tostring(v)
- end
- if showkeys and type(k) ~= "number" then
- table.insert(strargs,k.."="..argstr)
- else
- table.insert(strargs,argstr)
- end
- end
- return table.concat(strargs, ", ")
- end
- local realmethods = {}
- realmethods.Fire = Instance.new("BindableEvent").Fire
- realmethods.Invoke = Instance.new("BindableFunction").Invoke
- realmethods.FireServer = Instance.new("RemoteEvent").FireServer
- realmethods.InvokeServer = Instance.new("RemoteFunction").InvokeServer
- meta.__index = function(t,k)
- if (k == "Fire" or k == "Invoke" or k == "FireServer" or k == "InvokeServer") and (enabled[t.ClassName] and not ignore[t.Name]) then
- return function(self,...)
- local args = {...}
- local ret = {realmethods[k](self,...)}
- if EXTERNAL_LOGGING == true then
- if string.find(IGNORE_LIST, t.Name) then
- else
- console_print(t.ClassName.." called!\nPath: "..t:GetFullName().."\n".."Args: "..formatargs(args).."\nReturn: "..formatargs(ret), Color3.new(255/255, 170/255, 0/255))
- end
- else
- if string.find(IGNORE_LIST, t.Name) then
- else
- warn(t.ClassName.." called!\nPath: "..t:GetFullName().."\n".."Args: "..formatargs(args).."\nReturn: "..formatargs(ret), Color3.new(255/255, 170/255, 0/255))
- end
- end
- return unpack(ret)
- end
- else
- return oldmeta.__index(t,k)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement