Advertisement
rrixh

better dont log xhats

Sep 26th, 2023 (edited)
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.15 KB | None | 0 0
  1. if not game:IsLoaded() then
  2.     game.Loaded:Wait()
  3. end
  4.  
  5. local LP = game:GetService('Players').LocalPlayer
  6. local PlayerScripts = LP ~= nil and LP:FindFirstChild('PlayerScripts') or nil
  7. local ChatScript = PlayerScripts ~= nil and PlayerScripts:FindFirstChild('ChatScript') or nil
  8. local ChatMain = ChatScript ~= nil and ChatScript:FindFirstChild('ChatMain') or nil
  9.  
  10. if LP and ChatMain ~= nil then
  11.     local Old, Chatted, OldChatted = nil, Instance.new('BindableEvent'), LP.Chatted; Chatted.Name = LP.Name..'_Chatted_Event'
  12.     Old = hookmetamethod(game, '__index', newcclosure(function(self, Index)
  13.         if checkcaller() and self == LP and Index == 'Chatted' then
  14.             return Chatted.Event
  15.         elseif not checkcaller() and self == LP and Index == 'Chatted' then
  16.             return OldChatted
  17.         end
  18.    
  19.         return Old(self, Index)
  20.     end))
  21.    
  22.     local Old2, MessagePosted = nil, require(ChatMain).MessagePosted
  23.     if MessagePosted then
  24.         Old2 = hookfunction(MessagePosted.fire, function(self, ...)
  25.             if not checkcaller() then
  26.                 return Chatted:Fire(...)
  27.             end
  28.         end)
  29.     end
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement