How is it even possible that `print` in a server-side script prints to client's chat?



fivem3
The second pic is server.lua, so I have no idea how it’s possible that when I run the command, it’s not printing anything to the server console, but it prints the playerdata in my chat??

Its message routing, anything that’s printed via commands will get displayed to the client. You can probably write a print wrapper to get around this as it only prints to the client if its on the same frame.

See:

function cprint(...)
    CreateThread(function()
        Wait(0)
        print(...)
    end)
end

I personally don’t like the fact that commands print route to the client client as weird work arounds are needed to print information to the server, and it also causes a lot of confusion

YOU are a Godsend my friend. I have been looking for an answer to this for a long time… The amount of times I’ve wanted to add server prints to a command to log an issue or report abuse of a command has been numerous. Thank you for sharing this knowledge.