Advertisement
ERROR_CODE

Console

Jul 9th, 2023 (edited)
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.30 KB | None | 0 0
  1. local screen = Instance.new("ScreenGui")
  2. screen.IgnoreGuiInset = false
  3. screen.ResetOnSpawn = true
  4. screen.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  5. screen.Parent = game.CoreGui
  6. local console = Instance.new("Frame")
  7. console.BackgroundColor3 = Color3.new(0, 0, 0)
  8. console.Position = UDim2.new(0.358184755, 0, 0.264663815, 0)
  9. console.Size = UDim2.new(0.42, 0, 0.37, 0)
  10. console.Name = "Console"
  11. console.Parent = screen
  12. local uicorner = Instance.new("UICorner")
  13. uicorner.Parent = console
  14. local uistroke = Instance.new("UIStroke")
  15. uistroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  16. uistroke.Color = Color3.new(1, 1, 1)
  17. uistroke.Thickness = 2.4000000953674316
  18. uistroke.Parent = console
  19. local script = Instance.new("LocalScript")
  20. script.Name = "Script"
  21. script.Parent = console
  22. local console_2 = Instance.new("ScrollingFrame")
  23. console_2.CanvasSize = UDim2.new(0, 0, 0, 0)
  24. console_2.ScrollBarImageColor3 = Color3.new(0.137255, 0.211765, 0.266667)
  25. console_2.ScrollBarThickness = 0
  26. console_2.Active = true
  27. console_2.BackgroundColor3 = Color3.new(0.101961, 0.101961, 0.101961)
  28. console_2.BackgroundTransparency = 1
  29. console_2.BorderSizePixel = 0
  30. console_2.Position = UDim2.new(0.0167131703, 0, 0.00914634112, 0)
  31. console_2.Size = UDim2.new(0.89142859, 0, 0.984756112, 0)
  32. console_2.Name = "Console"
  33. console_2.Parent = console
  34. local logs = Instance.new("Folder")
  35. logs.Name = "Logs"
  36. logs.Parent = console_2
  37. local example = Instance.new("Frame")
  38. example.BackgroundColor3 = Color3.new(1, 1, 1)
  39. example.BackgroundTransparency = 1
  40. example.Size = UDim2.new(0.919871807, 0, 0.0526315793, 0)
  41. example.Visible = true
  42. example.Name = "Example"
  43. example.Parent = logs
  44. local line = Instance.new("TextLabel")
  45. line.Font = Enum.Font.SourceSans
  46. line.Text = "1 - "
  47. line.TextColor3 = Color3.new(255, 255, 255)
  48. line.TextSize = 14
  49. line.BackgroundColor3 = Color3.new(1, 1, 1)
  50. line.BackgroundTransparency = 1
  51. line.Position = UDim2.new(0.0514285713, 0, 0.073170729, 0)
  52. line.Size = UDim2.new(0.0696864128, 0, 0.502032518, 0)
  53. line.Visible = true
  54. line.Name = "Line"
  55. line.Parent = example
  56. local text = Instance.new("TextLabel")
  57. text.Font = Enum.Font.Code
  58. text.TextColor3 = Color3.new(255, 255, 255)
  59. text.TextSize = 14
  60. text.TextXAlignment = Enum.TextXAlignment.Left
  61. text.BackgroundColor3 = Color3.new(1, 1, 1)
  62. text.BackgroundTransparency = 1
  63. text.Position = UDim2.new(0.83341676, 0, 0.0997807458, 0)
  64. text.Size = UDim2.new(11.3000002, 0, 1, 0)
  65. text.Name = "txt"
  66. text.Parent = line
  67. local uilist_layout = Instance.new("UIListLayout")
  68. uilist_layout.Padding = UDim.new(0.0010000000474974513, 0)
  69. uilist_layout.SortOrder = Enum.SortOrder.LayoutOrder
  70. uilist_layout.Parent = logs
  71.  
  72. local modules = {}
  73. console_2.AutomaticCanvasSize = Enum.AutomaticSize.Y
  74. task.spawn(function()
  75.     local script = script
  76.  
  77.     local oldreq = require
  78.     local function require(target)
  79.         if modules[target] then
  80.             return modules[target]()
  81.         end
  82.         return oldreq(target)
  83.     end
  84.  
  85.  
  86.     local plr = game.Players.LocalPlayer
  87.     local Logs = script.Parent.Console.Logs -- Folder
  88.     local ExampleFrame = Logs.Example -- Line: 0
  89.  
  90.     local LineCount, LogText = 0, ""
  91.  
  92.  
  93.     local CreateMessage = function(...)
  94.         LineCount += 1
  95.         if LineCount >= 250 then
  96.             game.CoreGui.Screen.Console.Console.Logs["Line: " .. tostring(LineCount)]:Destroy()
  97.         end
  98.         local NewFrame = ExampleFrame:Clone()
  99.         NewFrame.Name = "Line: " .. tostring(LineCount) --Frame Name
  100.  
  101.         NewFrame.LayoutOrder = 1
  102.         NewFrame.Line.Text = tostring(LineCount) .. " - "  --First Label
  103.         NewFrame.Line.txt.Text = ...
  104.         NewFrame.Parent = Logs
  105.  
  106.     end
  107.  
  108.     local function tableToString(tbl)
  109.         local result = {}
  110.         local function traverseTable(t, indent)
  111.             for k, v in pairs(t) do
  112.                 if type(v) == "table" then
  113.                     result[#result + 1] = indent .. tostring(k) .. ": {"
  114.                     traverseTable(v, indent .. "  ")
  115.                     result[#result + 1] = indent .. "}"
  116.                 else
  117.                     result[#result + 1] = indent .. tostring(k) .. ": " .. tostring(v)
  118.                 end
  119.             end
  120.         end
  121.  
  122.         traverseTable(tbl, "")
  123.         return table.concat(result, "\n\n")
  124.     end
  125.  
  126.     local prt
  127.     prt = hookfunction(print, function(...)
  128.         local args = ...
  129.         if type(args) == "table" then
  130.             args = tableToString(args)
  131.         elseif type(args) == "function" then
  132.             args = getupvalues(args)
  133.         end
  134.         local message = tostring(args)
  135.         CreateMessage(message)
  136.         return warn(message)
  137.     end)
  138. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement