I want to be able to detect if a PRINT is called on the server or the client. In the output, this is showed by green and blue colors. And a “- client” after it. I want to be able to get a string or something that allows me to see if the print happens on client.
I am using LogService for this but I haven’t found a way to do it. Unless there isn’t a way to do this.
But the logservice script is server sided right? How would that work? @D0RYU there is a way to switch between server and local… I don’t think it would work that way.
You can run both of those serversided or clientsided.
Example
local RunService = game:GetService("RunService")
local DecideSide = RunService:IsServer() and "Server" or RunService:IsClient() and "Client"
print(DecideSide)
what are you talking about, this point has nothing to do with what I just said
game.Players.LocalPlayer is nil on a server script but it isn’t nil on a local script, honestly I don’t see why you can’t use what @caviarbro suggested
As I said, it won’t work. For some reason. The script that detects the Log output is on the server. I tested your localPlayer script and it kept saying server even on the client. Same goes for @caviarbro’s idea…
--SERVER
print(game:GetService("RunService"):IsServer() and "Server" or "Client")
print(game.Players.LocalPlayer == nil and "Server" or "Client")
--CLIENT
print(game:GetService("RunService"):IsServer() and "Server" or "Client")
print(game.Players.LocalPlayer == nil and "Server" or "Client")
Ok, you are probably not getting this correctly. You know how you separated and put the same scripts in a local script and a server script? I only use one script. Not two. And I am trying to detect using LogService. Which I don’t think works.
Pretty much. But (not my photo) It shows that the message was printed using the local and server with colors and stuff I wanted to see if LogService could detect that.