Advertisement
DrawingJhon

Enable ClassicChat

Jul 15th, 2022 (edited)
816
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.32 KB | None | 0 0
  1. local player = game:GetService("Players").LocalPlayer
  2. local playerScripts = player.PlayerScripts
  3. local Chat = game:GetService("Chat")
  4. local ChatSettings = require(Chat.ClientChatModules.ChatSettings)
  5.  
  6. ChatSettings.ClassicChatEnabled = true
  7.  
  8. if player.PlayerGui:FindFirstChild("Chat") then
  9.     player.PlayerGui.Chat:Destroy()
  10. end
  11.  
  12. if playerScripts:FindFirstChild("ChatScript") then
  13.     playerScripts.ChatScript:Destroy()
  14. end
  15.  
  16. local scr = game:GetObjects("rbxassetid://10221333356")[1]
  17. scr.Parent = playerScripts
  18.  
  19. local function Load(Object)
  20.     local Modules = {}
  21.     local SavedModules = {}
  22.     local Scripts = {}
  23.     local EnvList = {}
  24.    
  25.     local function fakeRequire(Script)
  26.         if typeof(Script) ~= "Instance" then warn("Unable to require: "..tostring(Script)) return end
  27.         if SavedModules[Script] then
  28.             return SavedModules[Script]
  29.         elseif Modules[Script] then
  30.             SavedModules[Script] = Modules[Script]()
  31.             return SavedModules[Script]
  32.         end
  33.         warn("Real requiring: "..Script:GetFullName())
  34.         return require(Script)
  35.     end
  36.     local function NewProxyEnv(Script, Func, Err)
  37.         if not Func then
  38.             warn("SYNTAX ERROR ("..Script:GetFullName().."): "..(Err or "Unknown"))
  39.         end
  40.         local fakeEnv = {script = Script}
  41.         local meta = {}
  42.         meta.__index = function(self, index)
  43.             if index == "require" then
  44.                 return fakeRequire
  45.             end
  46.             if index == "getfenv" then
  47.                 return function(arg)
  48.                     local typ = type(arg)
  49.                     local env
  50.                     if typ == "number" then
  51.                         env = getfenv(arg == 0 and 2 or arg + 1)
  52.                     else
  53.                         env = getfenv(arg)
  54.                     end
  55.                     if env.script == nil then
  56.                         error("Tried to get main envirionment")
  57.                     end
  58.                     return env
  59.                 end
  60.             end
  61.             return getfenv()[index]
  62.         end
  63.        
  64.         return setfenv(Func, setmetatable(fakeEnv, meta))
  65.     end
  66.     local function LoadScripts(Script)
  67.         if Script:IsA("Script") or Script.ClassName == "ModuleScript" then
  68.             local func = NewProxyEnv(Script, loadstring(Script.Source, "="..Script:GetFullName()))
  69.             if Script.ClassName == "Script" or Script.ClassName == "LocalScript" then
  70.                 Scripts[Script] = func
  71.             elseif Script.ClassName == "ModuleScript" then
  72.                 Modules[Script] = func
  73.             end
  74.         end
  75.        
  76.         for i, v in pairs(Script:GetChildren()) do
  77.             LoadScripts(v)
  78.         end
  79.     end
  80.     LoadScripts(Object)
  81.     for i, v in pairs(Scripts) do
  82.         task.spawn(v)
  83.     end
  84. end
  85.  
  86. Load(scr)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement