Get the Output value with a Script

I’m looking for a way to get the Output content with a Script, It would be some kind of Output.Content or Output.Text but in didn’t find any way to do get the Output… :frowning:

If you don't understand

When this Script is lauch

print("Hello world!")

It will show Hello world! in the Output, I’m looking for a way to get the Hello world! in a Script (to store this in a string variable)

local function GetOutput()
      return Output.Content --This doesn't work but it would be similar...
end
1 Like

You can use the LogService:

  1. Using LogService to know there new output text.
  2. Check if the type of the message is a “Output” or not.
  3. Store it in a table.
local allOutputs = {}

game:GetService("LogService").MessageOut:Connect(function(Message, Type)
    if Type == Enum.MessageType.MessageOutput then
        allOutputs[#allOutputs + 1] = Message
    end
end)

For other MessageType, you can find it here: MessageType | Documentation - Roblox Creator Hub

LogService in Wiki: LogService | Documentation - Roblox Creator Hub

This method is useful for you to check errors and debugging in your game.

6 Likes

it will be very usefull, since the game can advert-me and record the fails/errors number :slight_smile:
Thanks for supporting me!

1 Like