Advertisement
minimic2002

Roblox Remote Listening Demo

Sep 5th, 2020 (edited)
670
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. --- For the purpose of helping the community to see what an exploiter can see when you use remotes.
  2. local RS = game.ReplicatedStorage
  3.  
  4. function FindRemotes()
  5. local RSDes = RS:GetDescendants() -- Gets Everything In Replicated Storage
  6. local RemoteList = {}
  7.  
  8. for i = 1,#RSDes do
  9. if RSDes[i]:IsA("RemoteEvent") then
  10. table.insert(RemoteList,RSDes[i])
  11. end
  12. end
  13. end
  14.  
  15. function ListenForCommunication(RE)
  16. --------------------------------------------- Server Side
  17. if script:IsA("Script") then
  18. --- Listen For Remote Function
  19. RE.OnServerInvoke:Connect(function(Data)
  20. DisplayData(RE,Data,"ServerInvoke")
  21. end)
  22.  
  23. --- Listen For Remote Event
  24. RE.OnServerEvent:Connect(function(Data)
  25. DisplayData(RE,Data,"ServerEvent")
  26. end)
  27. end
  28.  
  29. ---------------------------------------------- Client Side
  30. if script:IsA("LocalScript") then
  31. --- Listen For Remote Function
  32. RE.OnClientInvoke:Connect(function(Data)
  33. DisplayData(RE,Data,"ClientInvoke")
  34. end)
  35.  
  36. --- Listen For Remote Event
  37. RE.OnClientEvent:Connect(function(Data)
  38. DisplayData(RE,Data,"ClientEvent")
  39. end)
  40. end
  41. end
  42.  
  43. function DisplayData(RE,Data,EventType)
  44.  
  45. if type(Data) == "table" then
  46. print("--------" .. RE.Name .. " " .. EventType)
  47. print("Table Data")
  48. for i = 1,#Data do
  49. print(Data[i])
  50. end
  51. end
  52.  
  53. if type(Data) == "string" then
  54. print("--------" .. RE.Name .. " " .. EventType)
  55. print("StringData")
  56. print(Data)
  57. end
  58.  
  59.  
  60. if typeof(Data) == "Instance" then
  61. print("--------" .. RE.Name .. " " .. EventType)
  62. print("Instance Data")
  63. print("Name: " .. Data.Name)
  64. print("ClassName: " ..Data.ClassName)
  65. end
  66. end
  67.  
  68. function StartListening()
  69. local RemoteList = FindRemotes()
  70. for i = 1,#RemoteList do
  71. ListenForCommunication(RemoteList[i])
  72. end
  73.  
  74. game.ReplicatedStorage.DescendantAdded:Connect(function(Des)
  75. if Des.ClassName == "RemoteEvent" then
  76. ListenForCommunication(Des)
  77. end
  78. end)
  79. end
  80. StartListening()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement