Advertisement
Lol1233

Revamped Client Remote Spy for SolaraV3

Aug 12th, 2024
7,648
-1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.26 KB | Source Code | 0 1
  1. warn("REVAMPED BY LUNA SCRIPTS")
  2. local function printArguments(...)
  3.  
  4.     local function printTable(tbl, indent)
  5.         indent = indent or " "
  6.         Index = 1
  7.         for k, v in pairs(tbl) do
  8.            
  9.             if type(v) == "table" then
  10.                 print(string.format("%s│ Argument %s: %s: Table (%s)", indent, tostring(Index), tostring(k), typeof(v)))
  11.                 task.wait(.1)
  12.                 printTable(v, indent .. "    ")
  13.             else
  14.                 print(string.format("%s│ Argument %s: ['%s'] = %s (%s)", indent, tostring(Index), tostring(k), tostring(v), typeof(v)))
  15.             end
  16.             Index += 1
  17.         end
  18.     end
  19.  
  20.     local args = {...}
  21.     print("┌── Arguments ────────────────────────────")
  22.     for i, arg in ipairs(args) do
  23.         if type(arg) == "table" then
  24.             warn("╔═════════════════════════════════════════╗")
  25.             warn(string.format("│ Argument %d: Table (%s)", i, typeof(arg)))
  26.             warn("╚═════════════════════════════════════════╝")
  27.             printTable(arg, "    ")
  28.         else
  29.             print(string.format("│ Argument %d: %s (%s)", i, tostring(arg), typeof(arg)))
  30.         end
  31.     end
  32.     print("└──────────────────────────────────────────")
  33. end
  34.  
  35. local function getRemotePath(remote)
  36.     local pathParts = {}
  37.     local current = remote
  38.  
  39.     while current and current ~= game do
  40.         table.insert(pathParts, 1, current.Name)
  41.         current = current.Parent
  42.     end
  43.     table.insert(pathParts, 1, "game")
  44.     return table.concat(pathParts, ".")
  45. end
  46.  
  47. local function printRemoteCall(remoteType, remote, printFunc)
  48.     local remotePath = getRemotePath(remote)
  49.     printFunc("╔═══════════════════════════════════════════════════════════════════╗")
  50.     printFunc(string.format("║ %s fired from: %s", remoteType, remotePath))
  51.     printFunc("╚═══════════════════════════════════════════════════════════════════╝")
  52. end
  53.  
  54. local function wrapRemote(remote)
  55.     if remote:IsA("RemoteEvent") then
  56.         remote.OnClientEvent:Connect(function(...)
  57.             printRemoteCall("RemoteEvent", remote, warn)
  58.             printArguments(...)
  59.         end)
  60.     elseif remote:IsA("RemoteFunction") then
  61.         remote.OnClientInvoke = function(...)
  62.             printRemoteCall("RemoteFunction", remote, error)
  63.             printArguments(...)
  64.         end
  65.     end
  66. end
  67.  
  68. local function wrapRemotesInFolder(folder)
  69.     for _, obj in ipairs(folder:GetDescendants()) do
  70.         if obj:IsA("RemoteEvent") or obj:IsA("RemoteFunction") then
  71.             wrapRemote(obj)
  72.         end
  73.     end
  74.     folder.DescendantAdded:Connect(function(descendant)
  75.         if descendant:IsA("RemoteEvent") or descendant:IsA("RemoteFunction") then
  76.             wrapRemote(descendant)
  77.         end
  78.     end)
  79. end
  80.  
  81. wrapRemotesInFolder(game.ReplicatedStorage)
  82. wrapRemotesInFolder(game.StarterGui)
  83. wrapRemotesInFolder(game.StarterPack)
  84. wrapRemotesInFolder(game.StarterPlayer)
  85.  
  86. game.ReplicatedStorage.DescendantAdded:Connect(function(descendant)
  87.     if descendant:IsA("RemoteEvent") or descendant:IsA("RemoteFunction") then
  88.         wrapRemote(descendant)
  89.     end
  90. end)
  91.  
  92. game.StarterGui.DescendantAdded:Connect(function(descendant)
  93.     if descendant:IsA("RemoteEvent") or descendant:IsA("RemoteFunction") then
  94.         wrapRemote(descendant)
  95.     end
  96. end)
  97.  
  98. game.StarterPack.DescendantAdded:Connect(function(descendant)
  99.     if descendant:IsA("RemoteEvent") or descendant:IsA("RemoteFunction") then
  100.         wrapRemote(descendant)
  101.     end
  102. end)
  103.  
  104. game.StarterPlayer.DescendantAdded:Connect(function(descendant)
  105.     if descendant:IsA("RemoteEvent") or descendant:IsA("RemoteFunction") then
  106.         wrapRemote(descendant)
  107.     end
  108. end)
  109.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement