Advertisement
ssssdsd1213

Untitled

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