How to get the context from output message?

Does Roblox provide any type of API to get the context of the message emitted by the output? with the context I mean if it’s emitted by the server/client as the output right now displays a different color based on the message side

This is probably what you want

1 Like

Yeah but it doesn’t provide any type of parameter to know the side from the message.

image

AFAIK LogService.MessageOut will only fire for output of the current context of the script running. If you use it in a LocalScript, it will fire for local output, and server output if running in a server script.

1 Like

Thanks, I guess I will need to make a ModuleScript to get the side from the message

Maybe try these RunService functions?
https://developer.roblox.com/en-us/api-reference/function/RunService/IsServer
https://developer.roblox.com/en-us/api-reference/function/RunService/IsClient

@jmt99 It doesn’t say anything about it not being replicated though :thinking: If that was the case then it would’ve shown up as this inside the API:

image

I want to make a custom output plugin and I need to get the context from the message emitted, if not, the custom output would be useless.

Yeah, it doesn’t care about the side from the emission, it just fires the event

image

@jmt99


Basically I think it’s impossible to get the context from the message, I guess the only thing to do it’s a engine feature request.

1 Like

That is true, but the API documentation is notoriously wrong sometimes. It wouldn’t make sense for the client-side to fire that event for the server as there is no player parameter even passed to the event, and you could potentially exploit that to locally print very large strings to replicate over the network and possibly crash or lag the server.

I also doubt that the server would notify all clients of its own output… sounds like a security hole. Clients should not be able to access information on the server. Even though you shouldn’t do this, someone could accidentally print an API key to the server output, and then it gets stolen, if that were the case.

This API also exists, which apparently does fire for clients with server output information, but it has RobloxScriptSecurity (for a good reason) and is probably used by the developer console: LogService | Roblox Creator Documentation

I think what you are seeing is simply a flaw of Roblox Studio itself and the fact that both DataModel contexts see each other’s output in the same window. I can’t even get this event to fire properly in a live game (unless I am somehow doing something wrong). Try it in one of your live games and see what happens.

Yes, but it’s a pathetic try from Roblox to protect it as most exploits bypasss RobloxScriptSecurity functions and can stole the information

Sadly, I want to use this for a plugin so it would be useless.

I guarantee you that there is a likely more to it than just the security tag protecting that event. They could fix that issue instantly by only firing that event for clients that have edit access (so, users who would have access to the server log in the developer console).

Also, most exploits cannot bypass RobloxScriptSecurity. An exploit that can run at CoreScript level would be a very high-end and prestigious exploit, that would have high priority in patching.

As long as MessageOut is working for you in plugins, I would think you should be able to use the various RunService methods to determine current context (unless those functions behave differently for plugins with APS). Try and print some of the values of those methods in your plugin when in the server vs client view and see what it does.

1 Like