Jack12332

ChatSpy

Mar 17th, 2024
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  1. --[[
  2. Simple Chat Spy
  3. Type "spy" to enable or disable the chat spy.
  4. Only tested if this works executed with Synapse (should work with other exploits though)
  5. --]]
  6.  
  7. print("Monkey HUB^^")
  8. print("Monkey HUB^^")
  9. print("Monkey HUB^^")
  10. print("Monkey HUB^^")
  11.  
  12. -- Config
  13. Config = {
  14. enabled = true,
  15. spyOnMyself = true,
  16. public = false,
  17. publicItalics = true
  18. }
  19.  
  20. -- Customizing Log Output
  21. PrivateProperties = {
  22. Color = Color3.fromRGB(0,255,255);
  23. Font = Enum.Font.SourceSansBold;
  24. TextSize = 18;
  25. }
  26.  
  27. local StarterGui = game:GetService("StarterGui")
  28. local Players = game:GetService("Players")
  29. local player = Players.LocalPlayer
  30. local saymsg = game:GetService("ReplicatedStorage"):WaitForChild("DefaultChatSystemChatEvents"):WaitForChild("SayMessageRequest")
  31. local getmsg = game:GetService("ReplicatedStorage"):WaitForChild("DefaultChatSystemChatEvents"):WaitForChild("OnMessageDoneFiltering")
  32. local instance = (_G.chatSpyInstance or 0) + 1
  33. _G.chatSpyInstance = instance
  34.  
  35. local function onChatted(p,msg)
  36. if _G.chatSpyInstance == instance then
  37. if p==player and msg:lower():sub(1,4)=="/spy" then
  38. Config.enabled = not Config.enabled
  39. wait(0.3)
  40. PrivateProperties.Text = "{SPY "..(Config.enabled and "EN" or "DIS").."ABLED}"
  41. StarterGui:SetCore("ChatMakeSystemMessage", PrivateProperties)
  42. elseif Config.enabled and (Config.spyOnMyself==true or p~=player) then
  43. msg = msg:gsub("[\n\r]",''):gsub("\t",' '):gsub("[ ]+",' ')
  44. local hidden = true
  45. local conn = getmsg.OnClientEvent:Connect(function(packet,channel)
  46. if packet.SpeakerUserId==p.UserId and packet.Message==msg:sub(#msg-#packet.Message+1) and (channel=="All" or (channel=="Team" and Config.public==false and Players[packet.FromSpeaker].Team==player.Team)) then
  47. hidden = false
  48. end
  49. end)
  50. wait(1)
  51. conn:Disconnect()
  52. if hidden and Config.enabled then
  53. if Config.public then
  54. saymsg:FireServer((Config.publicItalics and "/me " or '').."{SPY} [".. p.Name .."]: "..msg,"All")
  55. else
  56. PrivateProperties.Text = "{SPY} [".. p.Name .."]: "..msg
  57. StarterGui:SetCore("ChatMakeSystemMessage", PrivateProperties)
  58. end
  59. end
  60. end
  61. end
  62. end
  63.  
  64. for _,p in ipairs(Players:GetPlayers()) do
  65. p.Chatted:Connect(function(msg) onChatted(p,msg) end)
  66. end
  67.  
  68. Players.PlayerAdded:Connect(function(p)
  69. p.Chatted:Connect(function(msg) onChatted(p,msg) end)
  70. end)
  71.  
  72. PrivateProperties.Text = "{SPY "..(Config.enabled and "EN" or "DIS").."ABLED}"
  73. StarterGui:SetCore("ChatMakeSystemMessage", PrivateProperties)
  74. local chatFrame = player.PlayerGui.Chat.Frame
  75. chatFrame.ChatChannelParentFrame.Visible = true
  76. chatFrame.ChatBarParentFrame.Position = chatFrame.ChatChannelParentFrame.Position+UDim2.new(UDim.new(),chatFrame.ChatChannelParentFrame.Size.Y)
Add Comment
Please, Sign In to add comment