Admin only console output

Hello,

I’ve been working on a simple game mode and for debug and security reasons I was wondering how to output into console but only an admin or up can see? I was just trying to think how this could be done but have not figured it out yet. If it’s not something novice level to do just let me know at some point i’ll figure it out once I learn more.



for k,v in pairs( player.GetAll() ) do
 if v:IsAdmin() then
   print("stuff")
 end
end


-_- ahaha Thanks so much I figured it was something I was over thinking a bit.

that will just print to the server/client’s console once for every admin. instead of print, you would want to use Player:PrintMessage serverside.



for k,v in pairs( player.GetAll() ) do
 if v:IsAdmin() then
   v:PrintMessage(HUD_PRINTCONSOLE, "print this for all admins in their console");
 end
end


Didn’t see this until now… So you’re saying print is just going to post to the client and not technically to the actual server console but I will still be getting the same output just serverside.

If you ran that serverside, it will print “stuff” n times, where n is the number of admins in the server console. But using PrintMessage will send it to a client.