Charliezkie

Fast Remote Spy

Sep 8th, 2019
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.13 KB | None | 0 0
  1. -- FAST REMOTE SPY (v1.0.1) --
  2.  
  3. --[[
  4.      Changelog:
  5.    
  6.         v1.0.1:
  7.             Script now prints full path of object
  8. --]]
  9.  
  10. -- NOTE: FAST REMOTE SPY ONLY SUPPORTS RemoteEvents AT THE MOMENT. I WILL UPDATE IT.
  11.  
  12. local Settings = {
  13.     Scan = { -- Places where FRS will look for remotes
  14.         game:GetService("ReplicatedStorage"),
  15.         game.Workspace
  16.     },
  17.     Watch = { -- What FRS watches
  18.         RemoteEvent = true,
  19.         RemoteFunction = false, -- Doesn't work
  20.         BindableEvent = false, -- Doesn't work
  21.         BindableFunction = false -- Doesn't work
  22.     },
  23.     WatchNewObjects = true -- Watches any new objects on the Watch list that get added
  24. }
  25.  
  26. -- Made by OMG_Gaming404 --
  27.  
  28. function tprint (tbl, indent)
  29.   if not indent then indent = 0 end
  30.   local toprint = string.rep(" ", indent) .. "{\r\n"
  31.   indent = indent + 2
  32.   for k, v in pairs(tbl) do
  33.     toprint = toprint .. string.rep(" ", indent)
  34.     if (type(k) == "number") then
  35.       toprint = toprint .. "[" .. k .. "] = "
  36.     elseif (type(k) == "string") then
  37.       toprint = toprint  .. k ..  "= "  
  38.     end
  39.     if (type(v) == "number") then
  40.       toprint = toprint .. v .. ",\r\n"
  41.     elseif (type(v) == "string") then
  42.       toprint = toprint .. "\"" .. v .. "\",\r\n"
  43.     elseif (type(v) == "table") then
  44.       toprint = toprint .. tprint(v, indent + 2) .. ",\r\n"
  45.     else
  46.       toprint = toprint .. "\"" .. tostring(v) .. "\",\r\n"
  47.     end
  48.   end
  49.   toprint = toprint .. string.rep(" ", indent-2) .. "}"
  50.   return toprint
  51. end
  52.  
  53. local remotes = {RE = {}, RF = {}, BE = {}, BF = {}}
  54.  
  55. for i,v in next,Settings.Scan do
  56.     for ii,vv in next,v:GetDescendants() do
  57.         if vv:IsA("RemoteEvent") then
  58.             if Settings.Watch.RemoteEvent then
  59.                 table.insert(remotes.RE, table.getn(remotes.RE) + 1, vv)
  60.             end
  61.         end
  62.     end
  63. end
  64.  
  65. function exec(funcType, level, args, fullname)
  66.     if funcType == 1 then
  67.         if level == 1 then
  68.             print("[FRS] Remote Event executed {Ran Server-Side}. Arguments: "..tprint(args))
  69.         elseif level == 2 then
  70.             print("[FRS] Remote Event executed {Ran Client-Side}. Path: "..fullname.." Arguments: "..tprint(args)) 
  71.         end
  72.     elseif funcType == 2 then
  73.        
  74.     elseif funcType == 3 then
  75.        
  76.     end
  77. end
  78.  
  79. if Settings.WatchNewObjects then
  80.     for i,v in next,Settings.Scan do
  81.         v.DescendantAdded:connect(function(object)
  82.             if object:IsA("RemoteEvent") and Settings.Watch.RemoteEvent then
  83.                 object.OnServerEvent:connect(function(player,a,b,c,d,e,f,g,h,ii,j)
  84.                     local ar = {player,a,b,c,d,e,f,g,h,ii,j}
  85.                     exec(1,2,ar,object:GetFullName())
  86.                 end)
  87.                 object.OnClientEvent:connect(function(a,b,c,d,e,f,g,h,ii,j)
  88.                     local ar = {a,b,c,d,e,f,g,h,ii,j}
  89.                     exec(1,1,ar,object:GetFullName())
  90.                 end)
  91.             elseif object:IsA("RemoteFunction") and Settings.Watch.BindableFunction then
  92.                
  93.             elseif object:IsA("BindableEvent") and Settings.Watch.BindableEvent then
  94.             end
  95.         end)
  96.     end
  97. end
  98.  
  99. for i,v in next,remotes.RE do
  100.     v.OnServerEvent:connect(function(a,b,c,d,e,f,g,h,ii,j)
  101.         local ar = {a,b,c,d,e,f,g,h,ii,j}
  102.         exec(1,2,ar,v:GetFullName())
  103.     end)
  104.     v.OnClientEvent:connect(function(a,b,c,d,e,f,g,h,ii,j)
  105.         local ar = {a,b,c,d,e,f,g,h,ii,j}
  106.         exec(1,1,ar,v:GetFullName())
  107.     end)
  108. end
  109.  
  110. print("[FRS] Loaded!")
Add Comment
Please, Sign In to add comment