ColdSpecs

LBU Remote captured (Success)

Nov 2nd, 2025
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.65 KB | None | 0 0
  1. -- FireServer logger for a specific RemoteEvent named "shoot_event"
  2. -- Logs every call (even from your own scripts), with readable args.
  3.  
  4. local HttpService = game:GetService("HttpService")
  5.  
  6. local function shortInstancePath(inst)
  7. if typeof(inst) ~= "Instance" then return nil end
  8. local ok, full = pcall(function() return inst:GetFullName() end)
  9. return ok and full or (inst.ClassName .. "?" )
  10. end
  11.  
  12. local function dump(v, depth)
  13. depth = depth or 0
  14. if depth > 2 then return "<max-depth>" end
  15.  
  16. local t = typeof(v)
  17. if t == "number" or t == "boolean" or t == "nil" then
  18. return tostring(v)
  19. elseif t == "string" then
  20. return ('"%s"'):format(v)
  21. elseif t == "Vector3" then
  22. return ("Vector3(%.3f, %.3f, %.3f)"):format(v.X, v.Y, v.Z)
  23. elseif t == "Vector2" then
  24. return ("Vector2(%.3f, %.3f)"):format(v.X, v.Y)
  25. elseif t == "CFrame" then
  26. local p = v.Position
  27. return ("CFrame(p=(%.3f, %.3f, %.3f))"):format(p.X, p.Y, p.Z)
  28. elseif t == "Instance" then
  29. return ("Instance(%s)@%s"):format(v.ClassName, shortInstancePath(v) or "?")
  30. elseif t == "table" then
  31. local parts, n = {}, 0
  32. for k,val in pairs(v) do
  33. n += 1
  34. if n > 10 then table.insert(parts, "..."); break end
  35. table.insert(parts, ("%s=%s"):format(dump(k, depth+1), dump(val, depth+1)))
  36. end
  37. return "{" .. table.concat(parts, ", ") .. "}"
  38. else
  39. -- Fallback (userdata, RBXScriptSignal, etc.)
  40. local ok, json = pcall(function() return HttpService:JSONEncode(v) end)
  41. return ok and json or ("<%s:%s>"):format(t, tostring(v))
  42. end
  43. end
  44.  
  45. -- Hook __namecall
  46. local old
  47. old = hookmetamethod(game, "__namecall", function(self, ...)
  48. local method = getnamecallmethod()
  49. -- Remove the checkcaller() filter so we log LOCAL calls too.
  50. if method == "FireServer" and tostring(self) == "shoot_event" then
  51. local args = table.pack(...)
  52. local lines = {}
  53. for i = 1, args.n do
  54. lines[i] = ("Arg %d: %s"):format(i, dump(args[i]))
  55. end
  56. warn(("[%.2f] FireServer -> %s"):format(os.clock(), shortInstancePath(self) or tostring(self)))
  57. print(table.concat(lines, "\n"))
  58. end
  59. return old(self, ...)
  60. end)
  61.  
  62. -- (Optional) also see RemoteFunction:InvokeServer calls for the same object, if relevant.
  63. -- oldInvoke hook example:
  64. -- local oldInvoke = hookmetamethod(game, "__namecall", function(self, ...)
  65. -- local method = getnamecallmethod()
  66. -- if method == "InvokeServer" and tostring(self) == "shoot_event" then ... end
  67. -- return oldInvoke(self, ...)
  68. -- end)
  69.  
Advertisement
Add Comment
Please, Sign In to add comment