Advertisement
IDesireDreams

Roblox Chat Spy

Apr 14th, 2022
928
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. --This script reveals ALL hidden messages in the default chat
  2.  
  3. enabled = true --chat "/spy" to toggle!
  4. spyOnMyself = true --if true will check your messages too
  5. public = false --if true will chat the logs publicly (fun, risky)
  6. publicItalics = true --if true will use /me to stand out
  7. privateProperties = { --customize private logs
  8. Color = Color3.fromRGB(0,255,255);
  9. Font = Enum.Font.SourceSansBold;
  10. TextSize = 18;
  11. }
  12.  
  13.  
  14. local StarterGui = game:GetService("StarterGui")
  15. local Players = game:GetService("Players")
  16. local player = Players.LocalPlayer or Players:GetPropertyChangedSignal("LocalPlayer"):Wait() or Players.LocalPlayer
  17. local saymsg = game:GetService("ReplicatedStorage"):WaitForChild("DefaultChatSystemChatEvents"):WaitForChild("SayMessageRequest")
  18. local getmsg = game:GetService("ReplicatedStorage"):WaitForChild("DefaultChatSystemChatEvents"):WaitForChild("OnMessageDoneFiltering")
  19. local instance = (_G.chatSpyInstance or 0) + 1
  20. _G.chatSpyInstance = instance
  21.  
  22. local function onChatted(p,msg)
  23. if _G.chatSpyInstance == instance then
  24. if p==player and msg:lower():sub(1,4)=="/spy" then
  25. enabled = not enabled
  26. wait(0.3)
  27. privateProperties.Text = "{SPY "..(enabled and "EN" or "DIS").."ABLED}"
  28. StarterGui:SetCore("ChatMakeSystemMessage",privateProperties)
  29. elseif enabled and (spyOnMyself==true or p~=player) then
  30. msg = msg:gsub("[\n\r]",''):gsub("\t",' '):gsub("[ ]+",' ')
  31. local hidden = true
  32. local conn = getmsg.OnClientEvent:Connect(function(packet,channel)
  33. if packet.SpeakerUserId==p.UserId and packet.Message==msg:sub(#msg-#packet.Message+1) and (channel=="All" or (channel=="Team" and public==false and Players[packet.FromSpeaker].Team==player.Team)) then
  34. hidden = false
  35. end
  36. end)
  37. wait(1)
  38. conn:Disconnect()
  39. if hidden and enabled then
  40. if public then
  41. saymsg:FireServer((publicItalics and "/me " or '').."{SPY} [".. p.Name .."]: "..msg,"All")
  42. else
  43. privateProperties.Text = "{SPY} [".. p.Name .."]: "..msg
  44. StarterGui:SetCore("ChatMakeSystemMessage",privateProperties)
  45. end
  46. end
  47. end
  48. end
  49. end
  50.  
  51. for _,p in ipairs(Players:GetPlayers()) do
  52. p.Chatted:Connect(function(msg) onChatted(p,msg) end)
  53. end
  54. Players.PlayerAdded:Connect(function(p)
  55. p.Chatted:Connect(function(msg) onChatted(p,msg) end)
  56. end)
  57. privateProperties.Text = "{SPY "..(enabled and "EN" or "DIS").."ABLED}"
  58. StarterGui:SetCore("ChatMakeSystemMessage",privateProperties)
  59. if not player.PlayerGui:FindFirstChild("Chat") then wait(3) end
  60. local chatFrame = player.PlayerGui.Chat.Frame
  61. chatFrame.ChatChannelParentFrame.Visible = true
  62. chatFrame.ChatBarParentFrame.Position = chatFrame.ChatChannelParentFrame.Position+UDim2.new(UDim.new(),chatFrame.ChatChannelParentFrame.Size.Y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement