MaxproGlitcher

Print color on console .lua

May 29th, 2025
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. --
  2. getgenv().cprint = function(text, color)
  3. local printId = "##" .. tostring(math.random(1, 1e9))
  4. print(text .. " " .. printId)
  5.  
  6. task.spawn(function()
  7. local DevConsole = game:GetService("CoreGui").DevConsoleMaster.DevConsoleWindow.DevConsoleUI
  8. local ClientLog = DevConsole.MainView.ClientLog
  9.  
  10. for _, child in ipairs(ClientLog:GetChildren()) do
  11. local msg = child:FindFirstChild("msg")
  12. if msg and msg.Text:find(printId) then
  13. msg.TextColor3 = color
  14. msg.Text = msg.Text:gsub(printId, "")
  15. return
  16. end
  17. end
  18.  
  19. local connection
  20. connection = ClientLog.ChildAdded:Connect(function(child)
  21. local msg = child:FindFirstChild("msg")
  22. if msg and msg.Text:find(printId) then
  23. msg.TextColor3 = color
  24. msg.Text = msg.Text:gsub(printId, "")
  25. connection:Disconnect()
  26. end
  27. end)
  28. end)
  29. end
  30.  
  31. -- add your prints here using cprint, i will probably add some here for you to use idk
  32.  
  33. --[[
  34. cprint("Successfully loaded!", Color3.fromRGB(0, 255, 0))
  35. cprint("Warning: Low memory", Color3.fromRGB(255, 165, 0))
  36. cprint("Error: Script failed", Color3.fromRGB(255, 0, 0))
  37. ]]--
Advertisement
Add Comment
Please, Sign In to add comment