Advertisement
XZTablets

CPrint

Aug 6th, 2020
2,410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.21 KB | None | 0 0
  1. local DevConsole = game:GetService("CoreGui"):WaitForChild("DevConsoleMaster")
  2. local Window = DevConsole.DevConsoleWindow
  3. local UI = Window.DevConsoleUI
  4. local MainView = UI:WaitForChild("MainView")
  5. local ClientLog = MainView:WaitForChild("ClientLog")
  6.  
  7. local GetHighest = function(...)
  8.     local HighestValue
  9.     for _, Value in next, ... do
  10.         if not HighestValue or Value > HighestValue then
  11.             HighestValue = Value
  12.         end
  13.     end
  14.     return HighestValue
  15. end
  16.  
  17. local CPrint = function(...)
  18.     local Args = {...}
  19.     local TempColour = table.remove(Args)
  20.     local Colour
  21.     if typeof(TempColour) == "Color3" then
  22.         Colour = TempColour
  23.     else
  24.         Colour = Color3.fromRGB(255,255,255)
  25.         table.insert(Args, TempColour)
  26.     end
  27.     local CandidParts = {}
  28.     for _, Element in next, ClientLog:GetChildren() do
  29.         local Name = Element.Name
  30.         if Name:match("%d+") then
  31.             table.insert(CandidParts, tonumber(Element.Name))
  32.         end
  33.     end
  34.     local Expecting = GetHighest(CandidParts)
  35.     Expecting = Expecting and (Expecting + 1) or (2)
  36.     print(unpack(Args))
  37.     local ExpectedPart = ClientLog:WaitForChild(Expecting)
  38.     local MessagePart = ExpectedPart:FindFirstChild("msg")
  39.     if MessagePart then
  40.         MessagePart.TextColor3 = Colour
  41.     end
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement