Advertisement
AugusTH

Chat Spy (Raw)

Nov 19th, 2023
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.25 KB | None | 0 0
  1. --[[
  2. Name = - The name of the section.
  3. ]]
  4.  
  5. --[[
  6. Title = - The title of the notification.
  7. Content = - The content of the notification.
  8. Image = - The icon of the notification.
  9. Time = - The duration of the notfication.
  10. ]]
  11. --This script reveals ALL hidden messages in the default chat
  12. --chat "/spy" to toggle!
  13. enabled = true
  14. --if true will check your messages too
  15. spyOnMyself = true
  16. --if true will chat the logs publicly (fun, risky)
  17. public = false
  18. --if true will use /me to stand out
  19. publicItalics = true
  20. --customize private logs
  21. privateProperties = {
  22. Color = Color3.fromRGB(0,255,255);
  23. Font = Enum.Font.SourceSansBold;
  24. TextSize = 18;
  25. }
  26. local StarterGui = game:GetService("StarterGui")
  27. local Players = game:GetService("Players")
  28. local player = Players.LocalPlayer
  29. local saymsg = game:GetService("ReplicatedStorage"):WaitForChild("DefaultChatSystemChatEvents"):WaitForChild("SayMessageRequest")
  30. local getmsg = game:GetService("ReplicatedStorage"):WaitForChild("DefaultChatSystemChatEvents"):WaitForChild("OnMessageDoneFiltering")
  31. local instance = (_G.chatSpyInstance or 0) + 1
  32. _G.chatSpyInstance = instance
  33.  
  34. local function onChatted(p,msg)
  35. if _G.chatSpyInstance == instance then
  36. if p==player and msg:lower():sub(1,4)=="/spy" then
  37. enabled = not enabled
  38. wait(0.3)
  39. privateProperties.Text = "{SPY "..(enabled and "EN" or "DIS").."ABLED}"
  40. StarterGui:SetCore("ChatMakeSystemMessage",privateProperties)
  41. elseif enabled and (spyOnMyself==true or p~=player) then
  42. msg = msg:gsub("[\n\r]",''):gsub("\t",' '):gsub("[ ]+",' ')
  43. local hidden = true
  44. local conn = getmsg.OnClientEvent:Connect(function(packet,channel)
  45. 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
  46. hidden = false
  47. end
  48. end)
  49. wait(1)
  50. conn:Disconnect()
  51. if hidden and enabled then
  52. if public then
  53. saymsg:FireServer((publicItalics and "/me " or '').."{SPY} [".. p.Name .."]: "..msg,"All")
  54. else
  55. privateProperties.Text = "{SPY} [".. p.Name .."]: "..msg
  56. StarterGui:SetCore("ChatMakeSystemMessage",privateProperties)
  57. end
  58. end
  59. end
  60. end
  61. end
  62.  
  63. for _,p in ipairs(Players:GetPlayers()) do
  64. p.Chatted:Connect(function(msg) onChatted(p,msg) end)
  65. end
  66. Players.PlayerAdded:Connect(function(p)
  67. p.Chatted:Connect(function(msg) onChatted(p,msg) end)
  68. end)
  69. privateProperties.Text = "{SPY "..(enabled and "EN" or "DIS").."ABLED}"
  70. StarterGui:SetCore("ChatMakeSystemMessage",privateProperties)
  71. local chatFrame = player.PlayerGui.Chat.Frame
  72. chatFrame.ChatChannelParentFrame.Visible = true
  73. chatFrame.ChatBarParentFrame.Position = chatFrame.ChatChannelParentFrame.Position+UDim2.new(UDim.new(),chatFrame.ChatChannelParentFrame.Size.Y)
  74.  
  75. game.StarterGui:SetCore("SendNotification", {
  76. Title = "Credit To : Augus X";
  77. Text = "Script Loaded!| Rework By Augus X";
  78. Icon = "rbxthumb://type=Asset&id=6038460241&w=150&h=150";
  79. } )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement