Clientside only console command

I am unsure exactly how console commands work on the back end. Main thing I’m wondering is, are all console commands that a client uses sent to the server? If so isn’t that a lot of excess client-server communication, much I’m sure which is unnecessary?
If all console commands are sent to the server then is there a way to have a clientside only console command? It could be extremely useful for things such as menus in which you want to have a concommand that the user can bind to the key to open the menu but there really is no need for that to be sent to the server.

Yes, there are clientside-only commands. No, I’m pretty sure not all commands are sent to the server.

To make a purely clientside command, just do the usual concommand.Add in a client file. Severside command in a server file.

That will add the command to the server/client so then the specific side will recognize it. I’m just wondering, are all commands that are ran on the client sent to the server? And if so how do I prevent them from being sent to the server to prevent unnecessary communication?

The command is merely added clientside if you place the command in a clientside file. If you place the command in a serverside file, then it is defined both serverside and clientside. It’s how clientside addons like HUDs and such work without having to depend on the server. The command to activate a HUD would not need to be sent to the server to work.

As for whether the command is being sent to the server if it’s purely clientside, I don’t quite know. Possibly. Either people have kicked me from games (using Falco’s old script package) because they have an anti-hack that threw a false-negative or they’re seeing my clientside commands being sent to the server. Pretty sure it’s the former.

Ya, I fully understand how placing concommand.add in client will register it clientside only and same with server. It is just the USING of the command that I’m wondering about.

I’m kinda surprised that no one seems to know the answer to this. I assume the command is being sent to the server no matter what, but it seems pointless, and stopping that seems useful

If you place it serverside. You can call it clientside.

I dont think you fully understand my question or I worded it poorly.

I am wondering if every time you run a console command it is sent to the server EVEN if it doesnt need to be, thus causing unneeded server/client communication. (which I assume it does) And if so how do I stop a console command from being sent to the server?

I’m sure client-side concommands aren’t sent to the server, it should be fine

AFAIK it does actually make a very fast check on server, if it’s got a command registrered. Don’t hang me up on it though.