Advertisement
LuckyScripters

Anti Chat Logger

Jul 8th, 2024 (edited)
925
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.09 KB | None | 1 0
  1. -- Roblox -- Universal -- Anti Chat Logger
  2. -- Made by LuckyScripters
  3. -- Only works with LegacyChatService
  4.  
  5. local CoreGui = cloneref(game:GetService("CoreGui"))
  6. local StarterGui = cloneref(game:GetService("StarterGui"))
  7. local TextChatService = cloneref(game:GetService("TextChatService"))
  8.  
  9. local rawMetatable = getrawmetatable(StarterGui)
  10.  
  11. local originalIndex = rawMetatable.__index
  12. local originalNamecall = rawMetatable.__namecall
  13.  
  14. setreadonly(rawMetatable, false)
  15.  
  16. local notifySound = Instance.new("Sound", CoreGui)
  17. notifySound.Name = "Notification"
  18. notifySound.Volume = 0.25
  19. notifySound.SoundId = "rbxassetid://261072074"
  20.  
  21. rawMetatable.__index = newcclosure(function(self : Instance, index : any)
  22.     if self == StarterGui and index == "SetCore" then
  23.         local originalFunction = originalIndex(self, index)
  24.         return function(self : StarterGui, parameterName : string, bindableEvents : {[string] : any})
  25.             if parameterName == "CoreGuiChatConnections" then
  26.                 if bindableEvents.ChatWindow and bindableEvents.ChatWindow.MessagePosted then
  27.                     bindableEvents.ChatWindow.MessagePosted = nil
  28.                 end
  29.             end
  30.             return originalFunction(self, parameterName, bindableEvents)
  31.         end
  32.     end
  33.     return originalIndex(self, index)
  34. end)
  35.  
  36. rawMetatable.__namecall = newcclosure(function(self : Instance, ... : any)
  37.     if self == StarterGui and getnamecallmethod() == "SetCore" then
  38.         local arguments = {...}
  39.         local parameterName = arguments[1]
  40.         local bindableEvents = arguments[2]
  41.         if parameterName == "CoreGuiChatConnections" then
  42.             if bindableEvents.ChatWindow and bindableEvents.ChatWindow.MessagePosted then
  43.                 bindableEvents.ChatWindow.MessagePosted = nil
  44.             end
  45.         end
  46.     end
  47.     return originalNamecall(self, ...)
  48. end)
  49.  
  50. setreadonly(rawMetatable, true)
  51.  
  52. for index, value in getgc(true) do
  53.     if typeof(value) == "table" and rawget(value, "MessagePosted") then
  54.         for name, signalFunction in value.MessagePosted do
  55.             if name == "fire" then
  56.                 rawset(value.MessagePosted, "fire", function()
  57.                     return
  58.                 end)
  59.                 break
  60.             end
  61.         end
  62.     end
  63. end
  64.  
  65. if not game:IsLoaded() then
  66.     game.Loaded:Wait()
  67. end
  68.  
  69. if TextChatService.ChatVersion ~= Enum.ChatVersion.LegacyChatService then
  70.     StarterGui:SetCore("SendNotification", {
  71.         Title = "Anti Chat Logger",
  72.         Text = "Failed to disable chat logs, this game is using TextChatService and not LegacyChatService",
  73.         Icon = "",
  74.         Duration = 5,
  75.         Callback = nil,
  76.         Button1 = "Okay",
  77.         Button2 = nil
  78.     })
  79. else
  80.     StarterGui:SetCore("SendNotification", {
  81.         Title = "Anti Chat Logger",
  82.         Text = "Successfully disabled chat logs, you are now unbannable, enjoy!",
  83.         Icon = "",
  84.         Duration = 5,
  85.         Callback = nil,
  86.         Button1 = "Okay",
  87.         Button2 = nil
  88.     })
  89. end
  90.  
  91. notifySound:Play()
  92. notifySound.Ended:Wait()
  93. notifySound:Destroy()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement