Can you access the Output from a script?

Hello!
So I wanted to know if it was possible in Roblox to access the Output from a script.


I wanna do something like this:

if Output:Find("PluginStuffInOutput") then DeleteIt()

I wanna make a system so it automatically deletes the message in the output.

1 Like

https://developer.roblox.com/en-us/api-reference/function/LogService/GetLogHistory

Check this out.You can use the MessageOut event to find out if a message has been sent.Mark as the solution if it helped pls

Sample code from devhub

local msg = Instance.new("Message", workspace)
Game:GetService("LogService").MessageOut:Connect(function(Message, Type)
    msg.Text = "The message was "..Message.." and the type was "..tostring(Type)
end)
 
print("Hello, World!")
3 Likes

It helped but then how do I make it so it deletes the message?

1 Like

Pretty sure that is you cannot do it in luau. Also GetLogHistory and LogService in general is pretty unreliable, and the API may change at any time. I suggest you don’t use logging as a actual game feature. If your game is based on logging, then something is wrong with your game.

1 Like

Well, that is pretty much all I could find

Why would you even need to use LogService (if it isnt for a anti exploit)?

1 Like

Idk. But that was all I could find, and I don’t know why he wants to use it anyway

1 Like

you cant get which side Client/Server had made that output with LogService

1 Like

I never said that you could? Also on server scripts it will show the server logs and on client the client logs.

1 Like

that is what im talking about LogService.MessageOut will fire no matter which side had made that output for example

-- Server
local LogService = game:GetService("LogService")
LogService.MessageOut:Connect(function(message)
    print(message) -- will print client outputs too
end)
-- Client
print("something")

this cant be used for anti-exploit i mean

1 Like

Did you try it in a real server? It doesn’t work for me when playing in a real server. Also even if it works you wont know what client did it and you wont be able to kick him (Unless its a 1 player server)

1 Like

i have tested that in studio but this still shouldnt be used because if any of your game scripts will output something it will fire the event

2 Likes