artbarte

RemoteSpy by Autumn

Jul 31st, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. -- RemoteSpy for Intriga
  2. -- Written by Autumn on V3rmillion
  3.  
  4. local enabled = {
  5. -- Set any of these objects to false to stop logging them
  6. BindableEvent = true;
  7. BindableFunction = true;
  8. RemoteEvent = true;
  9. RemoteFunction = true;
  10. }
  11.  
  12. local ignore = {
  13. -- Any remotes matching the names listed below will be ignored
  14. Event = true;
  15. }
  16.  
  17. local meta,oldmeta = getrawmetatable(game),{}
  18. for i,v in next,meta do oldmeta[i] = v end
  19. function formatargs(args,showkeys)
  20. if #args == 0 then return "N/A" end
  21. local strargs = {}
  22. for k,v in next,args do
  23. local argstr = ""
  24. if type(v) == "string" then
  25. argstr = "\"" .. v .. "\""
  26. elseif type(v) == "table" then
  27. argstr = "{" .. formatargs(v,true) .. "}"
  28. else
  29. argstr = tostring(v)
  30. end
  31. if showkeys and type(k) ~= "number" then
  32. table.insert(strargs,k.."="..argstr)
  33. else
  34. table.insert(strargs,argstr)
  35. end
  36. end
  37. return table.concat(strargs, ", ")
  38. end
  39. local realmethods = {}
  40. realmethods.Fire = Instance.new("BindableEvent").Fire
  41. realmethods.Invoke = Instance.new("BindableFunction").Invoke
  42. realmethods.FireServer = Instance.new("RemoteEvent").FireServer
  43. realmethods.InvokeServer = Instance.new("RemoteFunction").InvokeServer
  44. meta.__index = function(t,k)
  45. if (k == "Fire" or k == "Invoke" or k == "FireServer" or k == "InvokeServer") and (enabled[t.ClassName] and not ignore[t.Name]) then
  46. return function(self,...)
  47. local args = {...}
  48. local ret = {realmethods[k](self,...)}
  49. warn(t.ClassName.." called!\nPath: "..t:GetFullName().."\n".."Args: "..formatargs(args).."\nReturn: "..formatargs(ret))
  50. return unpack(ret)
  51. end
  52. else
  53. return oldmeta.__index(t,k)
  54. end
  55. end
Add Comment
Please, Sign In to add comment